forked from libxmp/libxmp
-
Notifications
You must be signed in to change notification settings - Fork 2
/
watcom.mif.in
152 lines (128 loc) · 3.72 KB
/
watcom.mif.in
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
!ifeq USE_PROWIZARD 0
CFLAGS += -DLIBXMP_NO_PROWIZARD
!endif
!ifeq USE_DEPACKERS 0
CFLAGS += -DLIBXMP_NO_DEPACKERS
!endif
CFLAGS += -DHAVE_FNMATCH -DHAVE_MKSTEMP -DHAVE_UMASK
#CFLAGS += -DDEBUG
CFLAGS += -Iinclude
DLLFLAGS=-bd -DBUILDING_DLL
STATICFLAGS=-DLIBXMP_STATIC
DLLNAME=libxmp.dll
EXPNAME=libxmp.exp
# Note: not libxmp.map...
MAPNAME=xmp.map
LNKFILE=libxmp.lnk
LIBNAME=libxmp.lib
LIBSTATIC=xmp_static.lib
LBCFILE=libxmp.lbc
TESTNAME=libxmp-test.exe
## the lite version :
!ifeq TARGET_OS2 yes
DLLNAME_LITE=libxmplt.dll
LIBNAME_LITE=libxmplt.lib
!else
DLLNAME_LITE=libxmp-lite.dll
LIBNAME_LITE=libxmp-lite.lib
!endif
LNKLITE=libxmplt.lnk
EXPNAME_LITE=xmp-lite.exp
# Note: not libxmp.map...
MAPNAME_LITE=xmp-lite.map
LIBSTATIC_LITE=xmplite_static.lib
TESTNAME_LITE=libxmp-lite-test.exe
LBCLITE=libxmplt.lbc
!ifeq target static
CFLAGS += $(STATICFLAGS)
LIBFLAGS=$(CFLAGS)
BLD_TARGET=$(LIBSTATIC)
BLD_LIB=$(LIBSTATIC)
LITE_TARGET=$(LIBSTATIC_LITE)
LITE_LIB=$(LIBSTATIC_LITE)
!else
LIBFLAGS=$(CFLAGS) $(DLLFLAGS)
BLD_TARGET=$(DLLNAME)
BLD_LIB=$(LIBNAME)
LITE_TARGET=$(DLLNAME_LITE)
LITE_LIB=$(LIBNAME_LITE)
!endif
OBJS=@OBJS@
PROWIZ_OBJS=@POBJS@
DEPACKER_OBJS=@DOBJS@
LITE_OBJS=@LITE_OBJS@
ALL_OBJS=$(OBJS)
!ifeq USE_PROWIZARD 1
ALL_OBJS+= $(PROWIZ_OBJS)
!endif
!ifeq USE_DEPACKERS 1
ALL_OBJS+= $(DEPACKER_OBJS)
!endif
TEST_OBJS=test/md5.obj test/test.obj
TESTLITE_OBJS=test/md5.obj test/testlite.obj
all: $(BLD_TARGET)
dll: $(DLLNAME)
dll-lite: $(DLLNAME_LITE)
static: $(LIBSTATIC)
static-lite: $(LIBSTATIC_LITE)
lite: $(LITE_TARGET)
#.SUFFIXES: .obj .c
.c: src;src/depackers;src/depackers/lhasa;src/loaders;src/loaders/prowizard;src/lite;test
.c.obj:
$(CC) $(LIBFLAGS) -fo=$^@ $<
test/md5.obj: src/md5.c
$(CC) $(CFLAGS) -fo=$^@ $<
test/test.obj: test/test.c
$(CC) $(CFLAGS) -fo=$^@ $<
test/testlite.obj: test/testlite.c
$(CC) $(CFLAGS) -fo=$^@ $<
# rely on symbol name, not ordinal: -irn switch of wlib is default, but -inn is not.
$(DLLNAME) $(LIBNAME) $(EXPNAME): $(ALL_OBJS) $(LNKFILE)
wlink @$(LNKFILE)
wlib -q -b -n -c -pa -s -t -zld -ii -io -inn $(LIBNAME) +$(DLLNAME)
$(DLLNAME_LITE) $(LIBNAME_LITE) $(EXPNAME_LITE): $(LITE_OBJS) $(LNKLITE)
wlink @$(LNKLITE)
wlib -q -b -n -c -pa -s -t -zld -ii -io -inn $(LIBNAME_LITE) +$(DLLNAME_LITE)
$(LIBSTATIC): $(ALL_OBJS) $(LBCFILE)
wlib -q -b -n -c -pa -s -t -zld -ii -io $@ @$(LBCFILE)
$(LIBSTATIC_LITE): $(LITE_OBJS) $(LBCLITE)
wlib -q -b -n -c -pa -s -t -zld -ii -io $@ @$(LBCLITE)
test/$(TESTNAME): $(BLD_LIB) $(TEST_OBJS)
wlink NAM test/$(TESTNAME) SYSTEM $(SYSTEM) OP QUIET LIBR {$(BLD_LIB)} FIL {$(TEST_OBJS)}
test/$(TESTNAME_LITE): $(LITE_LIB) $(TESTLITE_OBJS)
wlink NAM test/$(TESTNAME_LITE) SYSTEM $(SYSTEM) OP QUIET LIBR {$(LITE_LIB)} FIL {$(TESTLITE_OBJS)}
check-build: test/$(TESTNAME) .symbolic
!ifneq target static
$(CMD_CP) $(DLLNAME) test
!endif
check: check-build .symbolic
cd test & $(TESTNAME)
checklite-build: test/$(TESTNAME_LITE) .symbolic
!ifneq target static
$(CMD_CP) $(DLLNAME_LITE) test
!endif
check-lite: checklite-build .symbolic
cd test & $(TESTNAME_LITE)
clean: .symbolic
rm -f src/*.obj
rm -f src/loaders/*.obj src/loaders/prowizard/*.obj
rm -f src/depackers/*.obj src/depackers/lhasa/*.obj
rm -f src/lite/*.obj
rm -f test/*.obj
distclean: clean .symbolic
rm -f *.err *.lnk *.lbc
rm -f $(DLLNAME) $(EXPNAME) $(MAPNAME) $(LIBNAME) $(LIBSTATIC) test/$(DLLNAME) test/$(TESTNAME)
rm -f $(DLLNAME_LITE) $(EXPNAME_LITE) $(MAPNAME_LITE) $(LIBNAME_LITE) $(LIBSTATIC_LITE) test/$(DLLNAME_LITE) test/$(TESTNAME_LITE)
!ifdef __UNIX__
CMD_CP=cp
!else
CMD_CP=copy
!endif
$(LBCFILE):
@echo Creating wlib commands file: $@
@%create $@
@for %i in ($(ALL_OBJS)) do @%append $@ +%i
$(LBCLITE):
@echo Creating wlib commands file: $@
@%create $@
@for %i in ($(LITE_OBJS)) do @%append $@ +%i