aboutsummaryrefslogtreecommitdiff
path: root/w9x/makefile
blob: 115d6d2372fda8b9b9eeb286bffae35f2b89ae79 (plain)
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
# Debug Settings
!ifeq debug 1
# Dump debug log to IOS debug log
debug_cflags = -DENABLE_DLOG=1
!endif

# Binaries to build
bins = chudisk.pdr
infs = chudisk.inf

# Object files for chudisk.pdr
pdr_objs = chupdr.obj

vxd_cflags = -osi -s -zc -w3 -wcd=202 -i=../inc $(debug_cflags)
# -osi to optimize for size, put intrinsics inline (to avoid runtime calls)
# -s to disable stack checks, since it inserts calls to the runtime
# -zc moves const data objects to text segment. required due to no data segment.
# -w3 enables warnings
# -wcd=202 disables the unreferenced function warning (e.g., for inline functions in headers)

compile_vxd = *wcc386 -fo=$^@ $(vxd_cflags) $[@

.BEFORE:
	# We need DOS and Windows headers, not host platform's
	set include=$(%watcom)/h/win;$(%watcom)/h

all: $(bins) .SYMBOLIC

chudisk.pdr: chudisk.lnk $(pdr_objs)
	*wlink @$[@ name $@ file { $(pdr_objs) }

chupdr.obj: chupdr.c .AUTODEPEND
	$(compile_vxd)

test.obj: test.asm .AUTODEPEND
	wasm -fo=$^@ $[@

clean: .SYMBOLIC
	rm -f $(bins)
	rm -f *.obj *.map