source: contrib/API/lib/Makefile

Last change on this file was 578, checked in by David Azarewicz, 12 years ago

API updates

File size: 2.9 KB
Line 
1# To build you must have installed :
2# OpenWatcom
3#
4# Copyright (C) 2010 David Azarewicz <david@88watts.net>
5# 07-Sep-2010 David Azarewicz Makefile changed to use Watcom tools
6
7!ifndef %WATCOM
8!error WATCOM must be defined in the environment.
9!endif
10
11WATCOM=$(%WATCOM)
12%PATH=$(WATCOM)\BINP;$(WATCOM)\BINW;$(%PATH)
13%INCLUDE=.;..\include;$(WATCOM)\H;$(WATCOM)\H\OS2;
14
15.ERASE
16.SUFFIXES
17.SUFFIXES: .lst .exe .obj .c .cpp .asm .lib .def
18
19# Options for Watcom C compiler
20# -bt=os2v2 = Build target OS is OS/2
21# -5s = Optimize for Pentium, use stack for variables in calls
22# -o = Optimization - i = enable inline intrinsic functions
23# l = enable loop optimizations
24# -s = Omit stack size checking from start of each function
25# -wx = Warning level set to maximum (vs 1..4)
26# -zq = Operate quietly
27# -zp4 = default packing 4
28CC=wcc386
29CFLAGS=-5s -bm -s -wx -orli -zq -zp4 -bt=os2v2_dll
30
31LINK=wlink
32
33# Options for Watcom assembler
34# -bt=os2 = Build target OS is OS/2
35# -d1 = Include line number info in object
36# (necessary to produce assembler listing)
37# -i = Include list
38# -zq = Operate quietly
39# -3p = 80386 protected-mode instructions
40#
41ASM=wasm
42AFLAGS=-5p -d1 -zq -bt=os2
43
44#since BEGINLIBPATH doesn't work, we load the dll's manually
45!ifdef __LOADDLL__
46!loaddll wlink $(WATCOM)\binp\dll\wlinkd.dll
47!loaddll wcc386 $(WATCOM)\binp\dll\wccd386.dll
48!loaddll wlib $(WATCOM)\binp\dll\wlibd.dll
49!endif
50
51OBJ=unilib.obj unictl.obj unipcm.obj uniaud.obj pcmmulti.obj cputest.obj fast_memcpy.obj fastmemcpy.obj resample.obj resample2.obj
52
53.c.obj: .AUTODEPEND
54 $(CC) $(CFLAGS) $*.c
55
56.asm.obj: .AUTODEPEND
57 $(ASM) $(AFLAGS) $*.asm
58
59
60all: uniaud.dll uniaud.lib
61
62uniaud.dll: $(OBJ) uniaud.def
63 @%create $^*.lrf
64 @%append $^*.lrf system os2v2_dll initinstance terminstance
65 @%append $^*.lrf option quiet
66 @%append $^*.lrf option manyautodata
67 @%append $^*.lrf option map
68 @%append $^*.lrf name $^.
69 @for %i in ($(OBJ)) do @%append $^*.lrf file %i
70 @%append $^*.lrf export=uniaud.def
71 $(LINK) @$^*.lrf
72 @%erase $^*.lrf
73
74uniaud_static.lib: $(OBJ)
75 @%create $^*.lbc
76 @for %i in ($(OBJ)) do @%append $^*.lbc +%i
77 wlib -n -b -q $^@ @$^*.lbc
78 @%erase $^*.lbc
79
80uniaud.lib: uniaud.dll
81 wlib -n -b -q -iro -p=16 uniaud.lib +uniaud.dll
82
83clean: .SYMBOLIC
84 @rm *.obj *.lib *.exe *.dll *.map *.lst
85
86xfast_memcpy.obj: fast_memcpy.c
87 $(CC) $(CFLAGS) -DFASTMEMCPY_TEST $*.c
88
89fast_memcpy.exe: fast_memcpy.obj fastmemcpy.obj cputest.obj
90 @%create $^*.lrf
91 @%append $^*.lrf system os2v2
92 @%append $^*.lrf option quiet
93 @%append $^*.lrf name $^.
94 @%append $^*.lrf file fast_memcpy.obj
95 @%append $^*.lrf file fastmemcpy.obj
96 @%append $^*.lrf file cputest.obj
97 $(LINK) @$^*.lrf
98 @%erase $^*.lrf
99
100
Note: See TracBrowser for help on using the repository browser.