Merged in MorphOS-specific improvements from MorphOS team.
[AROS.git] / tools / fd2inline / Makefile.in
blobeec25b12a3bfe47c9bb0df07eb88ecf986c4692c
1 srcdir = @srcdir@
2 VPATH = @srcdir@
4 prefix = @prefix@
5 exec_prefix = @exec_prefix@
7 bindir = @bindir@
8 libdir = @libdir@
9 includedir = @includedir@
10 guidedir = @guidedir@
12 INSTALL = @INSTALL@
13 INSTALL_PROGRAM = @INSTALL_PROGRAM@ -s
14 INSTALL_DATA = @INSTALL_DATA@
16 SHELL = /bin/sh
17 CC = @CC@
18 AR = ar
19 RM = rm -rf
20 CP = cp -a
21 MAKEINFO = makeinfo
22 LHA = lha -mraxe
23 MV = mv
24 STRIP = strip
25 TAR = tar -vz
26 RANLIB = @RANLIB@
27 AWK = @AWK@
28 DEFS = @DEFS@
29 LIBS = @LIBS@
30 CFLAGS = $(DEFS) -Wall -Wstrict-prototypes \
31 '-DVERSION="$(VERSION)"' @CFLAGS@
32 LDFLAGS = @LDFLAGS@
34 # Used when building fd2inline, fd2inline.guide and the archives.
35 VERSION = 1.37
37 AMIGAOS_FD_PATH = @amigaos_fd_path@
38 AMIGAOS_HEADER_PATH = @amigaos_header_path@
39 POS_FD_PATH = @pos_fd_path@
40 POS_HEADER_PATH = @pos_header_path@
42 # Pseudo-targets.
43 AMIGAOS_INLINES = @amigaos_inlines@
44 BUILD_AMIGAOS_INLINES = stmp-built-amigaos-inlines
45 BUILD_AMIGAOS_PRAGMAS = stmp-built-amigaos-pragmas
46 BUILD_AMIGAOS_PROTOS = stmp-built-amigaos-protos
47 BUILD_AMIGAOS_LIBS = stmp-built-amigaos-libs
48 POS_INLINES = @pos_inlines@
49 BUILD_POS_INLINES = stmp-built-pos-inlines
51 # List of linker libraries to build. Each entry is INCBASE!LIBBASE (see below).
52 NONSTD_LIBS = muimaster!mui ums!ums dospath!dospath \
53 screennotify!screennotify wbstart!wbstart
55 # Archive names.
56 SRC_ARCHIVE_LHA = fd2inline-$(VERSION)-src.lha
57 SRC_ARCHIVE_TGZ = fd2inline-$(VERSION)-src.tgz
58 BIN_ARCHIVE = fd2inline-$(VERSION)-bin.lha
60 # Used when building archives
61 TMP_DIR = /tmp
62 TMP_SUBDIR = fd2inline-$(VERSION)
64 # Flags to pass to submake.
65 FLAGS_TO_PASS = "CC=$(CC)" \
66 "AWK=$(AWK)" \
67 "RM=$(RM)" \
68 "AR=$(AR)" \
69 "RANLIB=$(RANLIB)" \
70 "AMIGAOS_HEADER_PATH=$(AMIGAOS_HEADER_PATH)" \
71 "AMIGAOS_FD_PATH=$(AMIGAOS_FD_PATH)"
73 .PHONY: all guide amigaos_inlines pos_inlines nop install
74 .PHONY: dist alllib clean clobber
76 all: fd2inline guide $(AMIGAOS_INLINES) $(POS_INLINES)
78 fd2inline: fd2inline.c
79 $(CC) $(CFLAGS) $(LDFLAGS) -o fd2inline $(srcdir)/fd2inline.c $(LIBS)
81 install: all
82 $(INSTALL_PROGRAM) fd2inline $(bindir)/fd2inline
83 if [ -d include/inline ]; then \
84 if [ -d $(includedir)/inline ]; then true; else mkdir $(includedir)/inline; fi; \
85 $(INSTALL_DATA) $(srcdir)/include-src/inline/*.h $(includedir)/inline; \
86 $(INSTALL_DATA) include/inline/*.h $(includedir)/inline; \
87 else true; fi
88 if [ -d include/pragmas ]; then \
89 if [ -d $(includedir)/pragmas ]; then true; else mkdir $(includedir)/pragmas; fi; \
90 $(INSTALL_DATA) include/pragmas/*.h $(includedir)/pragmas; \
91 else true; fi
92 if [ -d include/proto ]; then \
93 if [ -d $(includedir)/proto ]; then true; else mkdir $(includedir)/proto; fi; \
94 $(INSTALL_DATA) $(srcdir)/include-src/proto/*.h $(includedir)/proto; \
95 $(INSTALL_DATA) include/proto/*.h $(includedir)/proto; \
96 else true; fi
97 if [ -d include/pInline ]; then \
98 if [ -d $(includedir)/pInline ]; then true; else mkdir $(includedir)/pInline; fi; \
99 $(INSTALL_DATA) include/pInline/*.h $(includedir)/pInline; \
100 else true; fi
101 libs=`echo lib/lib*.a` ; if [ "lib/lib*.a" != "$${libs}" ]; then \
102 $(INSTALL_DATA) lib/lib*.a $(libdir); \
103 else true; fi
104 libs=`echo lib/libb/lib*.a` ; if [ "lib/libb/lib*.a" != "$${libs}" ]; then \
105 $(INSTALL_DATA) lib/libb/lib*.a $(libdir)/libb; \
106 else true; fi
107 libs=`echo lib/libb32/libm020/lib*.a` ; if [ "lib/libb32/libm020/lib*.a" != "$${libs}" ]; then \
108 $(INSTALL_DATA) lib/libb32/libm020/lib*.a $(libdir)/libb32/libm020; \
109 else true; fi
110 $(INSTALL_DATA) fd2inline.guide $(guidedir)
112 # "make dist" is only guaranteed to work when all the components (AmigaOS
113 # headers, AmigaOS libraries and p.OS headers) have been built.
114 dist: all
115 # Create a temporary location.
116 if [ -d $(TMP_DIR)/$(TMP_SUBDIR) ]; then true; else mkdir $(TMP_DIR)/$(TMP_SUBDIR); fi
117 if [ -d $(TMP_DIR)/$(TMP_SUBDIR)/include-src ]; then true; else mkdir $(TMP_DIR)/$(TMP_SUBDIR)/include-src; fi
118 if [ -d $(TMP_DIR)/$(TMP_SUBDIR)/include-src/inline ]; then true; else mkdir $(TMP_DIR)/$(TMP_SUBDIR)/include-src/inline; fi
119 if [ -d $(TMP_DIR)/$(TMP_SUBDIR)/include-src/proto ]; then true; else mkdir $(TMP_DIR)/$(TMP_SUBDIR)/include-src/proto; fi
120 if [ -d $(TMP_DIR)/$(TMP_SUBDIR)/lib ]; then true; else mkdir $(TMP_DIR)/$(TMP_SUBDIR)/lib; fi
121 # Copy the source directory to it.
123 cd $(srcdir); \
124 $(CP) include-src/inline/*.h $(TMP_DIR)/$(TMP_SUBDIR)/include-src/inline; \
125 $(CP) include-src/proto/*.h $(TMP_DIR)/$(TMP_SUBDIR)/include-src/proto; \
126 $(CP) lib/Makefile.in lib/splitasm.awk $(TMP_DIR)/$(TMP_SUBDIR)/lib; \
127 $(CP) manifests patches configure* COPYING fd2inline.c \
128 fd2inline.texi install.sh Makefile.in \
129 makemacros.awk makepragmas.awk Product-Info \
130 $(TMP_DIR)/$(TMP_SUBDIR) \
132 # Create the source archives.
134 cd $(TMP_DIR); \
135 $(LHA) a $(SRC_ARCHIVE_LHA) $(TMP_SUBDIR) \
137 $(RM) $(SRC_ARCHIVE_LHA)
138 $(CP) $(TMP_DIR)/$(SRC_ARCHIVE_LHA) .
139 $(RM) $(TMP_DIR)/$(SRC_ARCHIVE_LHA)
140 $(TAR) -cf $(SRC_ARCHIVE_TGZ) -C $(TMP_DIR) $(TMP_SUBDIR)
141 # Reorganize the temporary location.
143 cd $(TMP_DIR)/$(TMP_SUBDIR); \
144 $(MV) include-src include; \
145 $(RM) lib/* \
147 # Copy the build directory to the temporary location.
148 $(CP) include/inline include/pragmas include/proto include/pInline $(TMP_DIR)/$(TMP_SUBDIR)/include
149 if [ -d $(TMP_DIR)/$(TMP_SUBDIR)/bin ]; then true; else mkdir $(TMP_DIR)/$(TMP_SUBDIR)/bin; fi
150 $(CP) fd2inline $(TMP_DIR)/$(TMP_SUBDIR)/bin
151 $(STRIP) $(TMP_DIR)/$(TMP_SUBDIR)/bin/fd2inline
152 $(CP) lib/lib*.a $(TMP_DIR)/$(TMP_SUBDIR)/lib
153 if [ -d $(TMP_DIR)/$(TMP_SUBDIR)/lib/libb ]; then true; else mkdir $(TMP_DIR)/$(TMP_SUBDIR)/lib/libb; fi
154 $(CP) lib/libb/lib*.a $(TMP_DIR)/$(TMP_SUBDIR)/lib/libb
155 if [ -d $(TMP_DIR)/$(TMP_SUBDIR)/lib/libb32 ]; then true; else mkdir $(TMP_DIR)/$(TMP_SUBDIR)/lib/libb32; fi
156 if [ -d $(TMP_DIR)/$(TMP_SUBDIR)/lib/libb32/libm020 ]; then true; else mkdir $(TMP_DIR)/$(TMP_SUBDIR)/lib/libb32/libm020; fi
157 $(CP) lib/libb32/libm020/lib*.a $(TMP_DIR)/$(TMP_SUBDIR)/lib/libb32/libm020
158 if [ -d $(TMP_DIR)/$(TMP_SUBDIR)/guide ]; then true; else mkdir $(TMP_DIR)/$(TMP_SUBDIR)/guide; fi
159 $(CP) fd2inline.guide $(TMP_DIR)/$(TMP_SUBDIR)/guide
160 # Create the binary archive.
162 cd $(TMP_DIR); \
163 $(LHA) a $(BIN_ARCHIVE) $(TMP_SUBDIR)/ bin guide include lib COPYING \
165 $(RM) $(BIN_ARCHIVE)
166 $(CP) $(TMP_DIR)/$(BIN_ARCHIVE) .
167 $(RM) $(TMP_DIR)/$(BIN_ARCHIVE)
168 $(RM) $(TMP_DIR)/$(TMP_SUBDIR)
170 amigaos_inlines: $(BUILD_AMIGAOS_INLINES) $(BUILD_AMIGAOS_PRAGMAS) \
171 $(BUILD_AMIGAOS_PROTOS) $(BUILD_AMIGAOS_LIBS)
173 pos_inlines: $(BUILD_POS_INLINES) include/pInline/macros.h
175 nop:
177 $(BUILD_AMIGAOS_INLINES): fd2inline
178 if [ -d include ]; then true; else mkdir include; fi
179 if [ -d include/inline ]; then true; else mkdir include/inline; fi
180 for fd in $(AMIGAOS_FD_PATH)/*.fd; do \
181 rootname=`basename $$fd .fd | sed "s/_lib$$//"`; \
182 if [ "$${rootname}" = "mathffp" -o "$${rootname}" = "mathtrans" ]; then \
183 continue; \
184 else true; fi; \
185 echo "making include/inline/$$rootname.h..."; \
186 ./fd2inline $$fd $(AMIGAOS_HEADER_PATH)/clib/$${rootname}_protos.h -o include/inline/$$rootname.h; \
187 done
188 touch $(BUILD_AMIGAOS_INLINES)
190 $(BUILD_AMIGAOS_PRAGMAS): $(srcdir)/makepragmas.awk
191 if [ -d include ]; then true; else mkdir include; fi
192 if [ -d include/pragmas ]; then true; else mkdir include/pragmas; fi
193 for fd in $(AMIGAOS_FD_PATH)/*.fd; do \
194 rootname=`basename $$fd .fd | sed "s/_lib$$//"`; \
195 if [ "$${rootname}" = "mathffp" -o "$${rootname}" = "mathtrans" ]; then \
196 continue; \
197 else true; fi; \
198 echo "making include/pragmas/$${rootname}_pragmas.h..."; \
199 $(AWK) -f $(srcdir)/makepragmas.awk -v PRAGMAS=$$rootname >include/pragmas/$${rootname}_pragmas.h; \
200 done
201 touch $(BUILD_AMIGAOS_PRAGMAS)
203 $(BUILD_AMIGAOS_PROTOS): fd2inline
204 if [ -d include ]; then true; else mkdir include; fi
205 if [ -d include/proto ]; then true; else mkdir include/proto; fi
206 for fd in $(AMIGAOS_FD_PATH)/*.fd; do \
207 rootname=`basename $$fd .fd | sed "s/_lib$$//"`; \
208 if [ -f $(srcdir)/include-src/proto/$$rootname.h ]; then \
209 continue; \
210 else true; fi; \
211 echo "making include/proto/$$rootname.h..."; \
212 ./fd2inline --proto $$fd -o include/proto/$$rootname.h; \
213 done
214 touch $(BUILD_AMIGAOS_PROTOS)
216 $(BUILD_AMIGAOS_LIBS): fd2inline
217 for bases in $(NONSTD_LIBS); do \
218 incbase=`echo $$bases | sed "s/!.*$$//"`; \
219 libbase=`echo $$bases | sed "s/^.*!//"`; \
220 if [ -f include/inline/$$incbase.h ]; then \
221 echo "making lib$$libbase.a..."; \
222 (cd lib; $(MAKE) $(FLAGS_TO_PASS) INCBASE=$$incbase LIBBASE=$$libbase); \
223 else true; fi; \
224 done
225 touch $(BUILD_AMIGAOS_LIBS)
227 $(BUILD_POS_INLINES): fd2inline
228 if [ -d include ]; then true; else mkdir include; fi
229 if [ -d include/pInline ]; then true; else mkdir include/pInline; fi
230 for fd in $(POS_FD_PATH)/*.fd; do \
231 rootname=`basename $$fd .fd`; \
232 if [ "$${rootname}" = "pMathFFP2" -o "$${rootname}" = "pMathTrs2" ]; then \
233 continue; \
234 else true; fi; \
235 echo "making include/pInline/$$rootname.h..."; \
236 ./fd2inline --pos $$fd $(POS_HEADER_PATH)/pProto/$${rootname}.h -o include/pInline/$$rootname.h; \
237 done
238 touch $(BUILD_POS_INLINES)
240 include/pInline/macros.h: $(srcdir)/makemacros.awk
241 if [ -d include ]; then true; else mkdir include; fi
242 if [ -d include/pInline ]; then true; else mkdir include/pInline; fi
243 $(AWK) -f $(srcdir)/makemacros.awk >include/pInline/macros.h
245 guide: fd2inline.guide
247 fd2inline.guide: $(srcdir)/fd2inline.texi
248 if [ -f version.texi ]; then true; else echo "@set version $(VERSION)" >version.texi; fi
249 $(MAKEINFO) --amiga $(srcdir)/fd2inline.texi -o fd2inline.guide
251 info: fd2inline.info
253 fd2inline.info: $(srcdir)/fd2inline.texi
254 if [ -f version.texi ]; then true; else echo "@set version $(VERSION)" >version.texi; fi
255 $(MAKEINFO) $(srcdir)/fd2inline.texi -o fd2inline.info
257 # Make a linker library with stubs, if for some reason one can't use
258 # inline headers. This requires two arguments on "make" commandline:
260 # INCBASE: base name of the includes (muimaster for MUI etc).
261 # LIBBASE: base name of the library (mui for MUI etc).
263 alllib: fd2inline
264 if [ "$(INCBASE)" = "" -o "$(LIBBASE)" = "" ]; then \
265 echo "Require two arguments: INCBASE and LIBBASE"; \
266 else \
267 (cd lib; $(MAKE) $(FLAGS_TO_PASS) INCBASE=$(INCBASE) LIBBASE=$(LIBBASE)); \
270 clean:
271 $(RM) version.texi *.o *~ *!
272 (cd lib; $(MAKE) $(FLAGS_TO_PASS) clean)
274 clobber: clean
275 $(RM) fd2inline fd2inline.guide include \
276 $(BUILD_AMIGAOS_INLINES) $(BUILD_AMIGAOS_PRAGMAS) $(BUILD_AMIGAOS_PROTOS) \
277 $(BUILD_AMIGAOS_LIBS) $(BUILD_POS_INLINES) \
278 $(SRC_ARCHIVE_LHA) $(SRC_ARCHIVE_TGZ) $(BIN_ARCHIVE)
279 (cd lib; $(MAKE) $(FLAGS_TO_PASS) clobber)