]> 4ch.mooo.com Git - 16.git/blob - 16/adplug/libbinio/Makefile.wat
modified: 16/modex16/scroll.c
[16.git] / 16 / adplug / libbinio / Makefile.wat
1 # Watcom Makefile Patchwork 1.0
2 # Copyright (c) 2002, 2003 Simon Peter <dn.tlp@gmx.net>
3 #
4 # This (and only this) file is released under the terms and conditions
5 # of the Nullsoft license:
6 #
7 # This software is provided 'as-is', without any express or implied
8 # warranty.  In no event will the authors be held liable for any damages
9 # arising from the use of this software.
10 #
11 # Permission is granted to anyone to use this software for any purpose,
12 # including commercial applications, and to alter it and redistribute it
13 # freely, subject to the following restrictions:
14 #
15 # 1. The origin of this software must not be misrepresented; you must not
16 #    claim that you wrote the original software. If you use this software
17 #    in a product, an acknowledgment in the product documentation would be
18 #    appreciated but is not required.
19 # 2. Altered source versions must be plainly marked as such, and must not be
20 #    misrepresented as being the original software.
21 # 3. This notice may not be removed or altered from any source distribution.
22
23 ### PRECONFIGURATION ###
24 CC = wcc386
25 CXX = wpp386
26 LIB = wlib
27 LD = wlink
28 MAKE = wmake
29 ZIP = pkzip
30
31 CFLAGS =
32 CXXFLAGS =
33 CPPFLAGS =
34 LDFLAGS =
35 LIBFLAGS = -n -b
36 MAKEFLAGS = /h $+$(__MAKEOPTS__)$-
37 ZIPFLAGS = -P
38
39 #SUBDIRS =
40 #OUTPUT =
41 LIBRARIES =
42 OBJS =
43 DIST =
44 BINARYDIST =
45 SYSTEM = dos4g
46
47 #include_INST =
48 #lib_INST =
49 #bin_INST =
50
51 debug = no
52 installfile = install.txt
53 submakefile = Makefile.bt
54 configfile = config.mif
55 #distfile =
56 #binarydistfile =
57 distlist = srcdist.lst
58 binarydistlist = bindist.lst
59 bindir = .
60 includedir = .
61 libdir = .
62 #includesubdir =
63 ### PRECONFIGURATION END ###
64
65 !include $(submakefile)
66 !include $(configfile)
67
68 ### LOCAL VARIABLES ###
69 # All subdirectory-recursive targets
70 Recursive_Targets = all.recursive clean.recursive install.recursive &
71 uninstall.recursive
72
73 # Automatically distributed files
74 DIST += $(submakefile) $(installfile)
75
76 # Debugging support
77 !ifeq debug yes
78 CFLAGS += -d2
79 CXXFLAGS += -d2
80 LDFLAGS += debug all
81 !endif
82 ### LOCAL VARIABLES END ###
83
84 ### MAIN SECTION ###
85 .c.obj: .AUTODEPEND
86         $(CC) $(CFLAGS) $(CPPFLAGS) $[.
87
88 .cpp.obj: .AUTODEPEND
89         $(CXX) $(CXXFLAGS) $(CPPFLAGS) $[.
90
91 .obj.lib:
92         $(LIB) $(LIBFLAGS) $@ +$<
93
94 .obj.exe:
95         $(LD) $(LDFLAGS) N $@ F {$<} LIB {$(LIBRARIES)} SYS $(SYSTEM)
96 !ifeq SYSTEM pmodew
97         pmwlite /C4 $@
98         pmwsetup /Q /B0 $@
99 !endif
100
101 all: all.recursive $(OUTPUT) .symbolic
102
103 # Recurse through subdirectories.
104 $(Recursive_Targets): $(__MAKEFILES__) .symbolic
105 !ifdef CurrentSubdir
106         cd $(CurrentSubdir)
107         $(MAKE) /f ..\$[@ $(MAKEFLAGS) MAKEFLAGS=$(MAKEFLAGS) &
108                 configfile=..\$(configfile) $*
109 !else
110         for %d in ($(SUBDIRS)) do &
111                 $(MAKE) /f $[@ $(MAKEFLAGS) MAKEFLAGS=$(MAKEFLAGS) &
112                         configfile=$(configfile) CurrentSubdir=%d $@
113 !endif
114
115 !ifdef OUTPUT
116 $(OUTPUT): $(OBJS)
117 !endif
118
119 clean: clean.recursive .symbolic
120         for %f in ($(OBJS) $(OUTPUT) $(distlist) $(binarydistlist)) do &
121                 if exist %f del %f
122
123 distclean: clean .symbolic
124         for %f in ($(configfile) $(distfile) $(binarydistfile)) do &
125                 if exist %f del %f
126
127 # Install the binaries $(bin_INST) into the directory $(bindir). Install the
128 # headers $(include_INST) into the directory $(includesubdir), which is
129 # located in the directory $(includedir). Install the libraries $(lib_INST)
130 # into the directory $(libdir). If the directories do not exist, they are
131 # created. If some of the binaries or libraries do not exist, they are also
132 # created.
133 install: install.recursive $(OUTPUT) .symbolic
134 !ifdef include_INST
135         if not exist $(includedir) mkdir $(includedir)
136 !ifdef includesubdir
137         if not exist $(includedir)\$(includesubdir) &
138                 mkdir $(includedir)\$(includesubdir)
139         for %f in ($(include_INST)) do copy %f $(includedir)\$(includesubdir)
140 !else
141         for %f in ($(include_INST)) do copy %f $(includedir)
142 !endif
143 !endif
144 !ifdef lib_INST
145         if not exist $(libdir) mkdir $(libdir)
146         for %f in ($(lib_INST)) do copy %f $(libdir)
147 !endif
148 !ifdef bin_INST
149         if not exist $(bindir) mkdir $(bindir)
150         for %f in ($(bin_INST)) do copy %f $(bindir)
151 !endif
152
153 # Uninstalls previously installed files.
154 uninstall: uninstall.recursive .symbolic
155 !ifdef include_INST
156 !ifdef includesubdir
157         for %f in ($(include_INST)) do del $(includedir)\$(includesubdir)\%f
158         rmdir $(includedir)\$(includesubdir)
159 !else
160         for %f in ($(include_INST)) do del $(includedir)\%f
161 !endif
162 !endif
163 !ifdef lib_INST
164         for %f in ($(lib_INST)) do del $(libdir)\%f
165 !endif
166 !ifdef bin_INST
167         for %f in ($(bin_INST)) do del $(bindir)\%f
168 !endif
169
170 # Create a source distribution with filename $(distfile), containing the files
171 # $(DIST), using the program $(ZIP). Special options are in $(ZIPFLAGS).
172 !ifdef distfile
173 $(distlist): $(__MAKEFILES__)
174         if exist $(distlist) del $(distlist)
175         echo $[@ > $(distlist)
176         for %f in ($(DIST)) do echo %f >> $(distlist)
177
178 $(distfile): $(distlist)
179         $(ZIP) $(ZIPFLAGS) $(distfile) @$(distlist)
180
181 dist: $(distfile) .symbolic
182 !endif
183
184 # Create a binary distribution with filename $(binarydistfile), containing
185 # the files $(BINARYDIST), using the program $(ZIP). Special options are in
186 # $(ZIPFLAGS). If the binaries do not exist, they are created.
187 !ifdef binarydistfile
188 $(binarydistlist): $(__MAKEFILES__)
189         if exist $(binarydistlist) del $(binarydistlist)
190         for %f in ($(BINARYDIST)) do echo %f >> $(binarydistlist)
191
192 $(binarydistfile): $(binarydistlist)
193         $(ZIP) $(ZIPFLAGS) $(binarydistfile) @$(binarydistlist)
194
195 binary-dist: all $(binarydistfile) .symbolic
196 !endif
197
198 ### MAIN SECTION END ###