File: Makefile.os2

package info (click to toggle)
koules 1.4-22
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,812 kB
  • ctags: 3,325
  • sloc: ansic: 15,537; makefile: 824; asm: 379; tcl: 362; sh: 175
file content (133 lines) | stat: -rw-r--r-- 4,293 bytes parent folder | download | duplicates (13)
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
122
123
124
125
126
127
128
129
130
131
132
133
VERSION="Koules v1.1c - OS/2 Beta 3.2"

DEFINES=-D OS2VERSION=\"$(VERSION)\"
#edit this for your architekture!
#ARCH=-m386
ARCH=-m486
#ARCH=-mpentium
#uncoment following for joystick support
#JOYSTICK = -D JOYSTICK	#requires joystick toolkit installed!
#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/man/man6

#SOUNDOBJS = sound.o
#SOUNDDEV = /dev/dsp


INSTALL = install

CC	 = gcc
#OPTIMIZE = -Wall
OPTIMIZE = -I os2dive -fomit-frame-pointer -O6  -ffast-math -DOS2DIVE -DASSEMBLY -D__i386__ -Zomf -Zmt
OPTIMIZE1 = -I os2dive -fomit-frame-pointer -O6  -ffast-math -funroll-loops -finline-functions -DOS2DIVE -DASSEMBLY -D__i386__ -Zomf -Zmt
#OPTIMIZE =  -O2 -g -p
#OPTIMIZE1 =  -O2 -g  -p
CFLAGS	 = $(DEFINES) $(ARCH) $(JOYSTICK) -DSOUNDDIR="\"$(SOUNDDIR)\"" $(SOUND) $(MOUSE)\
	-DSOUNDSERVER=\"$(BINDIR)/$(SOUNDSERVER)\" \
	-DSOUNDDIR=\"$(SOUNDDIR)\" \
	-DSOUNDDEV=\"$(SOUNDDEV)\"

LFLAGS   =  -Zsys -Zmts -Zomf os2dive/koules.def

PROGS    = koules.exe
PROGS_O  = koules.obj menu.obj gameplan.obj font.obj intro.obj os2dive/pm_main.obj os2dive/init.obj os2dive/input.obj framebuffer.obj cmap.obj rcfiles.obj soundos2.obj
LIBS     = -ldive -los2me -lvga -lvgagl


all:	progs $(SOUNDSERVER)

progs : $(PROGS)

objs:	$(PROGS_O)

koules.exe: $(PROGS_O) koules.res
	$(CC) $(OPTIMIZE1) $(CFLAGS) $(LFLAGS) -o koules.exe $(PROGS_O) $(LIBS) -lm
	rc os2dive/koules $(PROGS)

koules.res: os2dive/koules.rc os2dive/pm_main.h
	rc -r os2dive/koules

font.obj: 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.obj: koules.c os2dive/interface.h
	$(CC) $(OPTIMIZE1) $(CFLAGS) -Wall -c  $< 

menu.obj: menu.c koules.h
	$(CC) $(CFLAGS) $(OPTIMIZE) -Wall -c  $<

gameplan.obj: gameplan.c koules.h
	$(CC) $(CFLAGS) $(OPTIMIZE) -Wall -c  $<

intro.obj: intro.c koules.h font.h text.h os2dive/interface.h
	$(CC) $(CFLAGS) $(OPTIMIZE) -Wall -c  $<

soundos2.obj: soundos2.c sound.h
	$(CC) $(CFLAGS) $(OPTIMIZE) -Wall -c $<

os2dive/pm_main.obj: os2dive/pm_main.c os2dive/interface.h \
  os2dive/input.h os2dive/pm_main.h
	$(CC) $(CFLAGS) $(OPTIMIZE) -Wall -c  -o os2dive/pm_main.obj $<

os2dive/init.obj: os2dive/init.c ./koules.h os2dive/pm_main.h ./framebuffer.h \
  os2dive/newbutton.c
	$(CC) $(CFLAGS) $(OPTIMIZE) -Wall -c  -o os2dive/init.obj $<

os2dive/input.obj: os2dive/input.c ./koules.h os2dive/pm_main.h
	$(CC) $(CFLAGS) $(OPTIMIZE) -Wall -c  -o os2dive/input.obj $<

framebuffer.obj: framebuffer.c koules.h os2dive/interface.h
	$(CC) $(CFLAGS) $(OPTIMIZE) -Wall -c  $<

cmap.obj: cmap.c koules.h
	$(CC) $(CFLAGS) $(OPTIMIZE) -Wall -c  $<

rcfiles.obj: rcfiles.c koules.h
	$(CC) $(CFLAGS) $(OPTIMIZE) -Wall -c  $<

install:: $(PROG) $(SOUNDSERVER)
	@echo "Koules directory is " $(BINDIR)
	@:
	@echo "Instalin man page to " $(MANDIR)
	$(INSTALL) -c $(INSTBINFLAGS) 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 $(INSTBINFLAGS) $(SOUNDSERVER) $(BINDIR); \
		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 $(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