-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile.os2
65 lines (53 loc) · 1.61 KB
/
Makefile.os2
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
# Makefile for OS/2 using Watcom compiler.
#
# wmake
# - builds unsf.dll and its import lib (unsf.lib)
#
# wmake target=static
# - builds the static library unsf_static.lib
CFLAGS = -bt=os2 -bm -fp5 -fpi87 -mf -oeatxh -w4 -ei -j -zp8 -zq
CFLAGS+= -DNDEBUG
# -5s : Pentium stack calling conventions.
# -5r : Pentium register calling conventions.
CFLAGS+= -5s
DLLFLAGS=-bd
.SUFFIXES:
.SUFFIXES: .obj .c
DLLNAME=unsf.dll
EXPNAME=unsf.exp
LIBNAME=unsf.lib
LIBSTATIC=unsf_static.lib
EXE=unsf.exe
EXE_STATIC=unsf_static.exe
INCLUDES=-I.
CFLAGS_LIB= $(CFLAGS) -DUNSF_BUILD
CFLAGS_EXE= $(CFLAGS)
!ifeq target static
BLD_TARGET=$(LIBSTATIC) $(EXE_STATIC)
!else
CFLAGS_LIB+= $(DLLFLAGS)
BLD_TARGET=$(DLLNAME) $(EXE)
!endif
OBJ=libunsf.obj
EXE_OBJ=unsf.obj
all: $(BLD_TARGET)
# rely on symbol name, not ordinal: -irn switch of wlib is default, but -inn is not.
$(DLLNAME): $(OBJ)
wlink NAM $@ SYSTEM os2v2_dll INITINSTANCE TERMINSTANCE OPTION QUIET OPTION MANYAUTODATA FIL {$(OBJ)} OPTION IMPF=$(EXPNAME)
wlib -q -b -n -c -pa -s -t -zld -ii -io -inn $(LIBNAME) +$(DLLNAME)
$(LIBSTATIC): $(OBJ)
wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(OBJ)
$(EXE): $(DLLNAME) $(EXE_OBJ)
wlink N $@ SYS OS2V2 OP QUIET LIBR {$(LIBNAME)} F {$(EXE_OBJ)}
$(EXE_STATIC): $(LIBSTATIC) $(EXE_OBJ)
wlink N $@ SYS OS2V2 OP QUIET LIBR {$(LIBSTATIC)} F {$(EXE_OBJ)}
# rules for library objs:
.c.obj:
wcc386 $(CFLAGS_LIB) $(INCLUDES) -fo=$^@ $<
# rules for exe objs:
unsf.obj: unsf.c
wcc386 $(CFLAGS_EXE) $(INCLUDES) -fo=$^@ $<
distclean: clean .symbolic
rm -f $(DLLNAME) $(EXPNAME) $(LIBNAME) $(LIBSTATIC) $(EXE) $(EXE_STATIC)
clean: .symbolic
rm -f *.obj