File: Makefile.svgalib

package info (click to toggle)
koules 1.4-1.2
  • links: PTS
  • area: main
  • in suites: hamm, potato, slink
  • size: 1,188 kB
  • ctags: 2,546
  • sloc: ansic: 15,513; makefile: 822; asm: 379; tcl: 362; sh: 160
file content (121 lines) | stat: -rw-r--r-- 3,503 bytes parent folder | download | duplicates (11)
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#edit this for your architecture!
#ARCH=-m386
#ARCH=-m486
#ARCH=-mpentium
#uncoment following for joystick support
#JOYSTICK = -D JOYSTICK	#requires joystick toolkit installed!
#uncoment following to enable network support
NET = -D NETSUPPORT
#uncoment following three lines for linux sound support
SOUND = -D SOUND
SOUNDSERVER = koules.sndsrv.linux
INSTALLSOUND = True
#uncoment following for mouse support
MOUSE = -D MOUSE
#don`t add / and spaces at end of path! 
#directories
SOUNDDIR = /usr/local/lib/koules
BINDIR = /usr/local/bin
MANDIR = /usr/local/man/man6

SOUNDOBJS = sound.o
SOUNDDEV = /dev/dsp

INSTBINFLAGS=-m a=rxs,u=rwxs
INSTALL = install

CC	 = gcc
OPTIMIZE = -Isvgalib -fomit-frame-pointer -O3 -ffast-math -s -Dlinux -Wall -DHAVEUSLEEP
OPTIMIZE1 = -I svgalib -fomit-frame-pointer -O6  -ffast-math -funroll-loops -finline-functions   -s -Dlinux -Wall -DHAVEUSLEEP
CFLAGS	 = $(DEFINES) $(ARCH) $(JOYSTICK) -DSOUNDDIR="\"$(SOUNDDIR)\"" $(SOUND) $(MOUSE) $(NET)\
	-DSOUNDSERVER=\"$(SOUNDDIR)/$(SOUNDSERVER)\" \
	-DSOUNDDIR=\"$(SOUNDDIR)\" \
	-DSOUNDDEV=\"$(SOUNDDEV)\"

LFLAGS   =  

PROGS    = koules.svga
PROGS_O  = koules.o sound.o menu.o gameplan.o font.o intro.o svgalib/init.o framebuffer.o cmap.o rcfiles.o server.o client.o sock.o objectsio.o
LIBS     = -lvgagl -lvga


all:	progs $(SOUNDSERVER)

progs : $(PROGS)

objs:	$(PROGS_O)

.c.o:
	$(CC) $(CFLAGS) $(OPTIMIZE) -Wall -c -o $*.o $<

.c.s:
	$(CC) $(CFLAGS) $(OPTIMIZE) -S -o $*.s $<

.o:
	$(CC) $(CFLAGS) $(OPTIMIZE1) $(LFLAGS) -o $* $*.o $(LIBS)
	chmod a+rs,go-w $*

font.o: font.c
	@echo please be patient.
	@echo the font.c is big and ugly i ripped it from zgv. 
	@echo do you know about better one?
	$(CC) $(OPTIMIZE1) $(CFLAGS) -c  $< 

koules.sndsrv.linux.o: koules.sndsrv.linux.c
	$(CC) $(OPTIMIZE1) $(CFLAGS) -c  $< 

koules.o: koules.c
	$(CC) $(OPTIMIZE1) $(CFLAGS) -Wall -c  $< 

koules.svga: $(PROGS_O)
	$(CC) $(OPTIMIZE1) $(CFLAGS) $(LFLAGS) -o koules.svga $(PROGS_O) $(LIBS) -lm

install:: $(PROG) $(SOUNDSERVER)
	@echo "Koules directory is " $(BINDIR)
	@:
	@echo "Instalin man page to " $(MANDIR)
	$(INSTALL) -c $(INSTMANFLAGS) koules.svga.6 $(MANDIR);
	@:
	@echo "Creating directory " $(BINDIR)
	@if [ ! -d $(BINDIR) ]; then mkdir $(BINDIR); fi
	$(INSTALL) -c -s $(INSTBINFLAGS) koules.svga $(BINDIR)
	@:
	@if [ "$(INSTALLSOUND)" = "True" ]; 				\
	 then								\
		echo "Creating directory " $(SOUNDDIR); 		\
		if [ ! -d $(SOUNDDIR) ]; then mkdir $(SOUNDDIR); fi;    \
		echo "Copying sound server to directory " $(SOUNDDIR); \
		$(INSTALL) -c -s $(INSTBIN1FLAGS) $(SOUNDSERVER) $(SOUNDDIR); \
		echo "Copying sound files into directory " $(SOUNDDIR); \
		cd ./sounds; set -x;					\
		for file in *.raw; do					\
		    $(INSTALL) -c $(INSTDATFLAGS) $$file $(SOUNDDIR);	\
		done;   						\
	 fi
	@echo "Don't forget to remove your old koules from /usr/games/koules "
	@echo "and /usr/games/kouleslib "


clean:
	rm -f koules.svga $(SOUNDSERVER)
	rm -f core `find . -name '*.[oas]' -print`
	rm -f core `find . -name '*~' -print`
	rm -f core `find . -type f -name 'core' -print`

indent:
	indent -di16 *.c *.h svgalib/*.c svgalib/*.h xlib/*.c xlib/*.h

lint:
	export LARCH_PATH=/usr/lib/lclint LCLIMPORTDIR=/usr/lib/lclint;\
	lclint -weak -Isvgalib $(DEFINES) *.c svgalib/*.c xlib/*.c 2>lint.out;\
	lclint -weak -Ixlib xlib/*.c 2>>lint.out

dep:
	rm -f .depend
	make .depend

.depend:
	echo '# Program dependencies' >.depend
	gcc -I svgalib $(DEFINES) -MM $(patsubst %.o,%.c,$(PROGS_O)) >>.depend

include .depend