File: Makefile

package info (click to toggle)
spacezero 0.80.06-1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, sid, stretch, wheezy
  • size: 6,308 kB
  • ctags: 1,347
  • sloc: ansic: 18,985; xml: 203; makefile: 58
file content (76 lines) | stat: -rw-r--r-- 2,500 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
CC = gcc 
BINDIR= ./bin
DATADIR= ./dat
SOUNDDIR= $(DATADIR)/sounds
SRCPATH= ./src
CONFIGDIR=$(HOME)/.spacezero
RECORDFILE=$(CONFIGDIR)record

#
# The binary executable will be copied in the next directory.
#
INSTALL_DIR=/usr/local/bin

#
# All data files will be copied in the next directory.
# tar.gz 

INSTALL_DATA_DIR=/usr/local/share/spacezero

# DEB pkg 
#INSTALL_DATA_DIR=/usr/share/spacezero




OPENALFLAGS= -lopenal -lalut
GTKFLAGS=`pkg-config --cflags gtk+-2.0`
#GTKFLAGS= -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pango-1.0 -I/usr/include/cairo
GTKLIBS=`pkg-config --libs gtk+-2.0`
#GTKLIBS=  -lgtk-x11-2.0 -lgdk-x11-2.0  -lglib-2.0
GTKLIBS12=`gtk-config --cflags`

LDFLAGS=  -lm -lpthread $(OPENALFLAGS) $(GTKLIBS)
LDFLAGS12=  -lm -lpthread $(OPENALFLAGS) $(GTKLIBS12)
CFLAGS=  -Wall -O3 -I./include -DDATADIR=\"$(DATADIR)\" -DINSTALL_DATA_DIR=\"$(INSTALL_DATA_DIR)\"
CFLAGS12=  -Wall -O3 -I./include -DGTK12 -DDATADIR=\"$(DATADIR)\" -DINSTALL_DATA_DIR=\"$(INSTALL_DATA_DIR)\"
PROGRAM=$(BINDIR)/spacezero


SOUND_OBJS= $(SRCPATH)/sound.o
SOUND_SRCS= $(SRCPATH)/sound.c


PROGRAM_OBJS=$(SRCPATH)/spacezero.o $(SRCPATH)/objects.o $(SRCPATH)/ai.o $(SRCPATH)/save.o $(SRCPATH)/shell.o $(SRCPATH)/spacecomm.o $(SRCPATH)/help.o $(SRCPATH)/comm.o $(SRCPATH)/graphics.o  $(SRCPATH)/functions.o $(SRCPATH)/data.o $(SOUND_OBJS)
PROGRAM_SRCS=$(SRCPATH)/spacezero.c $(SRCPATH)/objects.c $(SRCPATH)/ai.c $(SRCPATH)/save.c $(SRCPATH)/shell.c $(SRCPATH)/spacecomm.c $(SRCPATH)/help.c $(SRCPATH)/comm.c $(SRCPATH)/graphics.c  $(SRCPATH)/functions.c $(SRCPATH)/data.c $(SOUND_SRCS)



all: dirs spacezero


spacezero: $(PROGRAM_OBJS) 
	$(CC) $(GTKFLAGS) $(PROGRAM_OBJS)  $(LDFLAGS) $(CFLAGS) -g -o $(PROGRAM)

gtk12: $(PROGRAM_SRCS) 
	$(CC) `gtk-config --cflags` $(PROGRAM_SRCS)  $(LDFLAGS12) $(CFLAGS12) -g -o $(PROGRAM) `gtk-config --libs`

install:
	-if [ ! -d $(INSTALL_DIR) ] ; then mkdir -p $(INSTALL_DIR) ; fi
	-if [ ! -d $(INSTALL_DATA_DIR) ] ; then mkdir -p $(INSTALL_DATA_DIR); fi
	-if [ ! -d $(INSTALL_DATA_DIR)/sounds ] ; then mkdir -p $(INSTALL_DATA_DIR)/sounds; fi
	cp $(SOUNDDIR)/* $(INSTALL_DATA_DIR)/sounds
	cp $(PROGRAM) $(INSTALL_DIR)

dirs:
	-if [ ! -d $(BINDIR) ] ; then mkdir $(BINDIR) ; fi
	-if [ ! -d $(CONFIGDIR) ] ; then mkdir $(CONFIGDIR) ; fi

clean: 
	rm -f src/*.o bin/spacezero

mrproper: clean
	rm -f src/*~ include/*~

.c.o:	
	$(CC) -g  $(CFLAGS)  $(GTKFLAGS) -c $< -o  $@