# # Set the environmental variables for compiling # .ERASE .SUFFIXES: .SUFFIXES: .sys .obj .asm .inc .def .lrf .ref .lst .sym .map .c .cpp .h .lib NAME = runtime .BEFORE set INCLUDE= !ifndef %WATCOM set WATCOM=..\..\..\..\WATCOM !endif set PATH=$(%DDK)\BASE\TOOLS;$(%WATCOM)\BINP;$(%WATCOM)\BINW H=$(%DDK)\base\h INC=$(%DDK)\base\src\inc # Options for Watcom 16-bit C compiler # -bt=os2 = Build target OS is OS/2 # -ms = Memory model small # -3 = Enable use of 80386 instructions # -4 = Optimize for 486 (assumes -3) # -5 = Optimize for Pentium (assumes -3) # -d1 = Include line number info in object # (necessary to produce assembler listing) # -o = Optimization - i = enable inline intrinsic functions # r = optimize for 80486 and pentium pipes # s = space is preferred to time # l = enable loop optimizations # a = relax aliasing constraints # n = allow numerically unstable optimizations # -s = Omit stack size checking from start of each function # -zl = Place no library references into objects # -wx = Warning level set to maximum (vs 1..4) # -zfp = Prevent use of FS selector # -zgp = Prevent use of GS selector # -zq = Operate quietly # -zm = Put each function in its own segment # -zu = Do not assume that SS contains segment of DGROUP # CC=wcc CPP=wpp !if "$(DEBUG)" == "0" CFLAGS=-ms -4 -bt=os2 -olinars -s -wx -zl -zfp -zgp -zq -zu -zm !else CFLAGS=-ms -4 -bt=os2 -d1 -olinars -s -wx -zl -zfp -zgp -zq -zu -zm -DDEBUG !endif CINC=-i$(%WATCOM)\H;$(%WATCOM)\H\SYS;$(H) # Options for Watcom assembler # -bt=os2 = Build target OS is OS/2 # -d1 = Include line number info in object # (necessary to produce assembler listing) # -i = Include list # -zq = Operate quietly # ASM=wasm AFLAGS=-bt=os2 -d1 -zq AINC=-i$(INC) # Inference rules .c.obj: .AUTODEPEND $(CC) $(CFLAGS) $(CINC) $*.c wdisasm -l -s $* .cpp.obj: .AUTODEPEND $(CPP) $(CFLAGS) $(CINC) $*.cpp wdisasm -l -s $* .asm.obj: .AUTODEPEND $(ASM) $(AFLAGS) $(AINC) $*.asm wdisasm -l -s $* # Object file list OBJ1=math.obj ctype.obj string.obj cpp.obj printf.obj OBJ2=iodelay.obj devhelp.obj OBJS=$(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) all: $(NAME).lib ################################## # Target descriptions ################################## $(NAME).lrf: makefile.os2 @%write $^@ $(NAME).lib @for %f in ($(OBJS)) do @%append $^@ -+ %f $(NAME).lib: $(OBJS) makefile.os2 $(NAME).lrf wlib @$(NAME).lrf clean: del *.obj *.err *.lnk *.sys *.sym *.lst *.map *.wmap *.lrf *.lib