-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (34 loc) · 832 Bytes
/
Makefile
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
CF_ALL = -1 -za99 -we -q -d3 -bt=dos -ox -fpi87 -ms -i=libxt/include
LIBF_ALL = -q -n
LDF_ALL = -q -bcl=dos -lr clibs.lib
ASF_ALL = -I libxt/include/
CC = wcc
LIB = wlib
LD = wcl
AS = nasm
COMP = $(CC) $(CF_ALL) $(CF_TGT) -ad=$(patsubst %.c,%.d,$<) $< -fo=$@
MKLIB = $(LIB) $(LIBF_ALL) $(LIBF_TGT) $@ $(patsubst %,+%,$^)
LINK = $(LD) $(LDF_ALL) -fe=$@ $^
ASM = $(AS) -f obj $(ASF_ALL) $< -o $@ -l $(patsubst %.asm,%.lst,$<)
COM = $(AS) -f bin $(ASF_ALL) $< -o $@ -l $(patsubst %.asm,%.lst,$<)
d = .
dir = .
all: targets
include Rules.mk
# general rules
%.o: %.c
$(COMP)
%.com: %.asm
$(COM)
%.o: %.asm
$(ASM)
%.exe: %.o
$(LINK)
%.lib:
$(MKLIB)
# phony rules
.PHONY: targets
targets: $(TGT_BIN) $(TGT_LIB)
.PHONY: clean
clean:
rm -f $(CLEAN)