fixing C compatibility problems
[dosdemo] / Makefile
1 baseobj = main.obj
2 demoobj = demo.obj screen.obj gfxutil.obj 3dgfx.obj polyfill.obj
3 scrobj = tunnel.obj fract.obj grise.obj polytest.obj plasma.obj
4 sysobj = gfx.obj vbe.obj dpmi.obj timer.obj keyb.obj mouse.obj logger.obj tinyfps.obj
5 obj = $(baseobj) $(demoobj) $(sysobj) $(scrobj)
6 bin = demo.exe
7
8 libs = imago.lib
9
10 def = -dM_PI=3.141592653589793
11 opt = -5 -fp5 -otexan -oh -oi -ei
12 dbg = -d1
13
14 !ifdef __UNIX__
15 incpath = -Isrc -Isrc/dos -Ilibs/imago/src
16 libpath = libs/imago
17 !else
18 incpath = -Isrc -Isrc\dos -Ilibs\imago\src
19 libpath = libs\imago
20 !endif
21
22 AS = nasm
23 CC = wcc386
24 CXX = wpp386
25 ASFLAGS = -fobj
26 CFLAGS = $(dbg) $(opt) $(def) -zq -bt=dos $(incpath)
27 CXXFLAGS = $(CFLAGS)
28 LDFLAGS = libpath $(libpath) library { $(libs) }
29 LD = wlink
30
31 $(bin): cflags.occ $(obj) libs/imago/imago.lib
32         %write objects.lnk $(obj)
33         $(LD) debug all name $@ system dos4g file { @objects } $(LDFLAGS)
34
35 .c: src;src/dos
36 .cc: src;src/dos
37 .asm: src;src/dos
38
39 cflags.occ: Makefile
40         %write $@ $(CFLAGS)
41
42 cxxflags.occ: Makefile
43         %write $@ $(CXXFLAGS)
44
45 .c.obj: .autodepend
46         $(CC) -fo=$@ @cflags.occ $[*
47
48 .cc.obj: .autodepend
49         $(CXX) -fo=$@ @cxxflags.occ $[*
50
51 .asm.obj:
52         $(AS) $(ASFLAGS) -o $@ $[*.asm
53
54 clean: .symbolic
55         del *.obj
56         del *.occ
57         del *.lnk
58         del $(bin)