forked from libxmp/libxmp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
watcom.mif.in
92 lines (75 loc) · 2.05 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
!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
LIBNAME=libxmp.lib
LIBSTATIC=xmp_static.lib
TESTNAME=libxmp-test.exe
!ifeq target static
CFLAGS += $(STATICFLAGS)
LIBFLAGS=$(CFLAGS)
BLD_TARGET=$(LIBSTATIC)
BLD_LIB=$(LIBSTATIC)
!else
LIBFLAGS=$(CFLAGS) $(DLLFLAGS)
BLD_TARGET=$(DLLNAME)
BLD_LIB=$(LIBNAME)
!endif
OBJS=@OBJS@
PROWIZ_OBJS=@POBJS@
DEPACKER_OBJS=@DOBJS@
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
all: $(BLD_TARGET)
#.SUFFIXES: .obj .c
.c: src;src/depackers;src/depackers/lhasa;src/loaders;src/loaders/prowizard;test
.c.obj:
$(CC) $(LIBFLAGS) -fo=$^@ $<
test/md5.obj: src/md5.c
$(CC) $(CFLAGS) -fo=$^@ $<
test/test.obj: test/test.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)
wlink NAM $(DLLNAME) SYSTEM $(SYSTEM_DLL) INITINSTANCE TERMINSTANCE OP QUIET FIL {$(ALL_OBJS)} OP IMPF=$(EXPNAME) OP MAP=$(MAPNAME)
wlib -q -b -n -c -pa -s -t -zld -ii -io -inn $(LIBNAME) +$(DLLNAME)
$(LIBSTATIC): $(ALL_OBJS)
wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(ALL_OBJS)
test/$(TESTNAME): $(BLD_LIB) $(TEST_OBJS)
wlink NAM test/$(TESTNAME) SYSTEM $(SYSTEM) OP QUIET LIBR {$(BLD_LIB)} FIL {$(TEST_OBJS)}
check-build: test/$(TESTNAME) .symbolic
!ifneq target static
$(CMD_CP) $(DLLNAME) test
!endif
check: check-build .symbolic
cd test & $(TESTNAME)
clean: .symbolic
rm -f $(OBJS)
rm -f $(DEPACKER_OBJS)
rm -f $(PROWIZ_OBJS)
rm -f $(TEST_OBJS)
distclean: clean .symbolic
rm -f *.err
rm -f $(DLLNAME) $(EXPNAME) $(MAPNAME) $(LIBNAME) $(LIBSTATIC) test/$(DLLNAME) test/$(TESTNAME)
!ifdef __UNIX__
CMD_CP=cp
!else
CMD_CP=copy
!endif