dos port underway
[retroray] / Makefile
1 !ifdef __UNIX__
2 dosobj = src/dos/djdpmi.obj src/dos/gfx.obj src/dos/keyb.obj src/dos/logger.obj &
3         src/dos/main.obj src/dos/timer.obj src/dos/vbe.obj src/dos/vga.obj src/dos/watdpmi.obj
4 appobj = src/app.obj src/cmesh.obj src/darray.obj src/font.obj src/logger.obj &
5         src/meshgen.obj src/meshload.obj src/options.obj src/rbtree.obj src/rt.obj &
6         src/rtk.obj src/scene.obj src/scr_mod.obj src/scr_rend.obj src/util.obj
7 gawobj = src/gaw/gaw_sw.obj src/gaw/gawswtnl.obj src/gaw/polyclip.obj src/gaw/polyfill.obj
8
9 incpath = -Isrc -Isrc/dos -Ilibs -Ilibs/imago/src -Ilibs/treestor/include -Ilibs/drawtext
10 libpath = libpath libs/dos
11 !else
12 dosobj = src\dos\djdpmi.obj src\dos\gfx.obj src\dos\keyb.obj src\dos\logger.obj &
13         src\dos\main.obj src\dos\timer.obj src\dos\vbe.obj src\dos\vga.obj src\dos\watdpmi.obj
14 appobj = src\app.obj src\cmesh.obj src\darray.obj src\font.obj src\logger.obj &
15         src\meshgen.obj src\meshload.obj src\options.obj src\rbtree.obj src\rt.obj &
16         src\rtk.obj src\scene.obj src\scr_mod.obj src\scr_rend.obj src\util.obj
17 gawobj = src\gaw\gaw_sw.obj src\gaw\gawswtnl.obj src\gaw\polyclip.obj src\gaw\polyfill.obj
18
19 incpath = -Isrc -Isrc\dos -Ilibs -Ilibs\imago\src -Ilibs\treestor\include -Ilibs\drawtext
20 libpath = libpath libs\dos
21 !endif
22
23 obj = $(dosobj) $(appobj) $(gawobj)
24 bin = retroray.exe
25
26 opt = -otexan
27 def = -DGFX_SW
28 libs = imago.lib treestor.lib drawtext.lib
29
30 AS = nasm
31 CC = wcc386
32 LD = wlink
33 ASFLAGS = -fobj
34 CFLAGS = -d3 -5 -fp5 $(opt) $(def) -s -zq -bt=dos $(incpath)
35 LDFLAGS = option map $(libpath) library { $(libs) }
36
37 $(bin): cflags.occ $(obj) $(libs)
38         %write objects.lnk $(obj)
39         %write ldflags.lnk $(LDFLAGS)
40         $(LD) debug all name $@ system dos4g file { @objects } @ldflags
41
42 .c: src;src/dos;src/gaw
43 .asm: src;src/dos;src/gaw
44
45 cflags.occ: Makefile
46         %write $@ $(CFLAGS)
47
48 .c.obj: .autodepend
49         $(CC) -fo=$@ @cflags.occ $[*
50
51 .asm.obj:
52         nasm $(ASFLAGS) -o $@ $[*.asm
53
54
55 !ifdef __UNIX__
56 clean: .symbolic
57         rm -f $(obj)
58         rm -f $(bin)
59         rm -f cflags.occ *.lnk
60
61 imago.lib:
62         cd libs/imago
63         wmake
64         cd ../..
65
66 treestor.lib:
67         cd libs/treestor
68         wmake
69         cd ../..
70
71 drawtext.lib:
72         cd libs/drawtext
73         wmake
74         cd ../..
75
76 !else
77
78 imago.lib:
79         cd libs\imago
80         wmake
81         cd ..\..
82
83 treestor.lib:
84         cd libs\treestor
85         wmake
86         cd ..\..
87
88 drawtext.lib:
89         cd libs\drawtext
90         wmake
91         cd ..\..
92
93 clean: .symbolic
94         del src\*.obj
95         del src\dos\*.obj
96         del src\gaw\*.obj
97         del *.lnk
98         del cflags.occ
99         del $(bin)
100 !endif