1 XCOMM $TOG: DtInfo.rules /main/21 1997/09/05 11:31:01 samborn $
3 /* Note whether we are the top level project. */
4 #ifndef SeenTopLevelProject
5 # define SeenTopLevelProject YES
6 # define DtInfoIsTopLevelProject YES
8 # define DtInfoIsTopLevelProject NO
11 /* Chain project rules files. */
14 /* Include our favorites in PROJECT_DEFINES. */
15 #ifndef DtInfoProjectDefines
16 # define DtInfoProjectDefines $(DTINFO_DEFINES) $(WIDEC_DEFINES) $(I18N_DEFINES) $(SEARCH_DEFINES) $(DLOPEN_DEFINES) $(LM_DEFINES) $(BYTE_ORDER_DEFINES)
19 # undef ProjectDefines
21 #define ProjectDefines \
22 X11ProjectDefines MotifProjectDefines CdeProjectDefines DtInfoProjectDefines
24 /* Ditto for CXXPROJECT_DEFINES. */
25 #ifndef DtInfoCplusplusProjectDefines
26 # define DtInfoCplusplusProjectDefines DtInfoProjectDefines
28 #ifdef CplusplusProjectDefines
29 # undef CplusplusProjectDefines
31 #define CplusplusProjectDefines \
32 X11CplusplusProjectDefines MotifCplusplusProjectDefines CdeCplusplusProjectDefines DtInfoCplusplusProjectDefines
36 * library building stuff
39 #if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 5
40 # define makelibT(libname) @@\
43 Concat3(libname/lib,libname,T.a): FRC @@\
45 echo STR(*** Making lib libname Templates ***) ; \ @@\
46 $(MAKE) Concat3(lib,libname,T.a) ; \ @@\
49 # define makelibsubsubdir(subdir,libname) @@\
51 Concat(subdir/libname/lib,libname.a): FRC @@\
53 echo STR(*** Making lib libname ***) ; \ @@\
54 $(MAKE) Concat(libname/lib,libname.a) ; \ @@\
57 # define makelibTsubsubdir(subdir,libname) @@\
59 Concat3(subdir/libname/lib,libname,T.a): FRC @@\
61 echo STR(*** Making lib libname Templates ***) ; \ @@\
62 $(MAKE) Concat3(libname/lib,libname,T.a) ; \ @@\
64 #else /* not defined(SunArchitecture) && CplusplusCompilerMajorVersion > 5 */
65 # define makelibT(libname) @@\
69 #define makelib(libname) @@\
72 #define makelibd(libname, deps) @@\
73 Concat(libname/lib,libname.a): deps FRC @@\
75 echo STR(*** Making lib libname ***) ; \ @@\
76 $(MAKE) Concat(lib,libname.a) ; \ @@\
77 if [ -d "$(TEMPLATE_DB)" ]; then \ @@\
78 $(MAKE) Concat3(lib,libname,T.a) ; \ @@\
81 libname/libname.d: libname/Classlist.mk @@\
83 echo STR(*** Making dfiles in libname ***) ; \ @@\
84 $(MAKE) libname.d ;\ @@\
86 libname/libname.h: libname/Classlist.mk @@\
88 echo STR(*** Making dfiles in libname ***) ; \ @@\
89 $(MAKE) libname.h ;\ @@\
91 libname/libname.msg: libname/Classlist.mk @@\
93 echo STR(*** Making msgs in libname ***) ; \ @@\
94 $(MAKE) libname.msg ;\ @@\
101 XCOMM makes toplevel Prelude.h
103 #define make_prelude(libraries, deps) @@\
106 $(OLIAS)/tools/misc/pmaker libraries
110 XCOMM build .d and .h files within a library
112 #define make_libfiles(library,classes) @@\
113 dfiles:: Concat(library,.d) Concat(library,.h) @@\
114 Concat(library,.d) : Classlist.mk @@\
116 $(OLIAS)/tools/misc/dfiles d library classes @@\
117 Concat(library,.h) : Classlist.mk @@\
119 $(OLIAS)/tools/misc/dfiles h library classes @@\
121 $(RM) Concat(library,.d) Concat(library,.h)
123 #define make_msgs(library, msgs) @@\
124 messages:: Concat(library,.msg) @@\
125 Concat(library,.msg) : Classlist.mk msgs @@\
127 cat msgs > Concat(library,.msg) @@\
129 $(RM) Concat(library,.msg)
131 XCOMM Build a library
132 XCOMM *NOTE* SimpleLibrary does *not* build a real ar-style
133 XCOMM library; it merely uses ld -r -o to concatenate a set
134 XCOMM of .o's together. Use RealLibrary to build an honest-
135 XCOMM -to-gosh ranlib'd library. Unless you really need true
136 XCOMM library behavior (partial selection of contents, etc.),
137 XCOMM SimpleLibrary is the better choice.
139 #define SimpleLibraryWithAddedObjs(libname,objlist,libdir,objlist1) @@\
140 AllTarget(Concat(lib,libname.a)) @@\
142 Concat(lib,libname.a): objlist @@\
144 @echo "### Making SimpleLibraryWithAddedObjs libname.a" @@\
145 $(LD) -r -o $@ objlist objlist1
147 #define SimpleLibrary(libname,objlist,libdir) @@\
148 AllTarget(Concat(lib,libname.a)) @@\
150 Concat(lib,libname.a): objlist @@\
152 @echo STR(*** Making SimpleLibrary libname.a) @@\
153 $(LD) -r -o $@ objlist
156 #if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 5
157 #define SimpleLibraryT(libname,objlist,libdir) @@\
158 SimpleLibrary(libname,objlist,libdir) @@\
160 AllTarget(Concat3(lib,libname,T.a)) @@\
162 Concat3(lib,libname,T.a): @@\
164 @echo STR(*** Making SimpleLibraryT libname Templates) @@\
165 find ./Templates.DB -name '*.o' -type f -print | xargs -n4 ar cq $@ @@\
170 #define SimpleLibraryT(libname,objlist,libdir) @@\
171 SimpleLibrary(libname,objlist,libdir) @@\
173 AllTarget(Concat3(lib,libname,T.a)) @@\
175 Concat3(lib,libname,T.a): TemplateObjs @@\
177 @echo STR(*** Making SimpleLibraryT libname Templates) @@\
178 $(AR) $@ TemplateObjs @@\
181 $(RM) -r $(TEMPLATE_DB)
184 #define RealLibrary(libname,objlist,libdir) @@\
185 AllTarget(Concat(lib,libname.a)) @@\
187 Concat(lib,libname.a): objlist @@\
189 @echo STR(*** Making RealLibrary libname.a) @@\
193 #define NotSoSimpleLibrary(libname,objlist,libdir,otherdeps) @@\
194 AllTarget(Concat(lib,libname.a)) @@\
196 Concat(lib,libname.a): objlist otherdeps @@\
198 @echo STR(*** Making NotSoSimpleLibrary libname.a) @@\
199 $(LD) -r -o $@ objlist
201 #if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 5
202 #define NotSoSimpleLibraryT(libname,objlist,libdir,otherdeps) @@\
203 NotSoSimpleLibrary(libname,objlist,libdir,otherdeps) @@\
205 AllTarget(Concat3(lib,libname,T.a)) @@\
207 Concat3(lib,libname,T.a): @@\
209 @echo STR(*** Making NotSoSimpleLibraryT libname Templates) @@\
210 find ./Templates.DB -name '*.o' -type f -print | xargs -n4 ar cq $@ @@\
215 #define NotSoSimpleLibraryT(libname,objlist,libdir,otherdeps) @@\
216 NotSoSimpleLibrary(libname,objlist,libdir,otherdeps) @@\
218 AllTarget(Concat3(lib,libname,T.a)) @@\
220 Concat3(lib,libname,T.a): @@\
222 @echo STR(*** Making NotSoSimpleLibraryT libname Templates) @@\
223 $(AR) $@ TemplateObjs @@\
226 $(RM) -r $(TEMPLATE_DB)
229 #define do_subdirs_imakefile(subdirs) /* nothing */
230 #define do_subdirs(subdirs) /* nothing */
232 #define foreach_subdirs(name, subdirs) @@\
233 NamedTargetSubdirs(name,subdirs,name,NullParameter,name)
235 /* Yacc and Lex Support */
237 #define SimpleCPlusPlusLexTarget(lexname) @@\
238 lexname.o : lexname.l @@\
240 $(FLEX) $(LFLAGS) -t lexname.l > lexname.C @@\
241 $(CXX) -c $(CXXFLAGS) lexname.C
243 #define LexTarget(lexname, parsename) @@\
244 lexname.o : lexname.l @@\
245 $(RM) lexname.C lex.yy.c lexname.o @@\
246 $(FLEX) $(LFLAGS) lexname.l @@\
247 sed 's/yy/parsename/g' lex.yy.c | sed 's/YY/parsename/g' > lexname.C @@\
248 $(CXX) -c $(CXXFLAGS) lexname.C @@\
249 $(RM) lexname.C lex.yy.c
251 #define YaccTarget(file, parser) @@\
253 $(RM) file.tab.h file.C y.tab.h y.tab.c file.o @@\
254 $(BYACC) $(YFLAGS) file.y @@\
255 sed 's/yy/parser/g' y.tab.h > file.tab.h @@\
256 sed 's/yy/parser/g' y.tab.c | sed 's/YY/parser/g' > file.C @@\
257 $(CXX) $(CXXFLAGS) -c file.C @@\
258 $(RM) file.C y.tab.h y.tab.c
261 * C++ Support (from here down...)
265 * On hp, *..c files need to be removed
267 #ifdef HPArchitecture
268 # define CplusObjectCompile(options) $(RM) $*..c $*.o $*.prep @@\
269 ObjectCplusplusCompile(options)
270 #else /* not defined(HPArchitecture) */
271 # define CplusObjectCompile(options) ObjectCplusplusCompile(options)
274 #define CplusIntermediateCompile(options) $(RM) $@ @@\
275 $(CXX) +i -c $(CXXFLAGS) options `basename $@ .c`CCsuf
277 /* need to remove this and "C++*", and use default from r6, with "CXX*": */
278 #ifdef NormalCplusplusObjectRule
279 # undef NormalCplusplusObjectRule
281 #define NormalCplusplusObjectRule() @@\
285 CplusObjectCompile($(_NOOP_))
287 #define HPchatr(program) @@\
289 chatr +s enable program
292 * Total bogosity with error codes:
293 * if [ `chatr $@ | grep 'libftft'` -gt 0 ] ; then \ @@\
294 * chatr -l `chatr $@ | grep 'libftft' | \ @@\
295 * sed -e 's|[^/]*\(/VOB/.*\)|\1|'` +s enable $@;\ @@\
297 * echo "chatr checked" @@\
300 #define ComplexCPlusPlusProgram(program) @@\
301 PROGRAM = program @@\
303 AllTarget(program) @@\
305 program: $(OBJS) $(DEPLIBS) @@\
306 RemoveTargetProgram($@) @@\
307 $(CXXLINK) -o $@ $(OBJS) $(CXXLDOPTIONS) $(STATIC) $(LOCAL_LIBRARIES) $(EXTRA_LOAD_FLAGS) $(EXTRA_LIBRARIES) $(SYS_LIBRARIES) @@\
312 #define CPlusPlusProgram(program,objects,libs) @@\
314 RemoveTargetProgram($@) @@\
315 $(CXXLINK) -o $@ objects $(CXXLDOPTIONS) $(STATIC) libs $(LDLIBS) $(EXTRA_LOAD_FLAGS) $(EXTRA_LIBRARIES) @@\
320 #define SimpleCPlusPlusProgram(program,objects,libs) @@\
321 AllTarget(program) @@\
322 CPlusPlusProgram(program,objects,libs)
326 #define SpecialCPlusPlusObjectRule(objs,depends,options) @@\
328 CplusObjectCompile(options) @@\
333 #define SpecialCPlusPlusExpandRule(expn,depends,options) @@\
335 CplusIntermediateCompile(options)
338 XCOMM CProgram is required by C modules in build-tools
340 #define CProgram(program,objects,libs) @@\
342 RemoveTargetProgram($@) @@\
343 $(CCLINK) -o $@ objects $(LDOPTIONS) $(STATIC) libs $(LDLIBS) $(EXTRA_LOAD_FLAGS) $(EXTRA_LIBRARIES) @@\
349 XCOMM SimpleCProgram is required by the C modules in buildtools to build
352 #define SimpleCProgram(program,objects,libs) @@\
353 AllTarget(program) @@\
354 CProgram(program,objects,libs)
358 XCOMM platform dependent executables, shell scripts
360 #define InstallLibFile(filename) @@\
361 InstallNonExecFile(filename,$(INSTALL_LIB_DIR))
364 XCOMM The following macros are used by the build tools
367 * InstallBuildToolsBinary - generate rules to install an executable
368 * program in build tools.
370 #ifndef InstallBuildToolsBinary
371 # define InstallBuildToolsBinary(program) @@\
372 install_buildtools:: @@\
373 MakeDir($(INSTALL_PLATFORM_ETC_DIR)) @@\
374 $(INSTALL) -c $(INSTPGMFLAGS) program $(INSTALL_PLATFORM_ETC_DIR)
375 #endif /* InstallBuildToolsBinary */
378 * InstallBuildToolsScript - generate rules for installing scripts
380 #ifndef InstallBuildToolsScript
381 # define InstallBuildToolsScript(program) @@\
382 install_buildtools:: program @@\
383 MakeDir($(INSTALL_BIN_DIR)) @@\
384 $(INSTALL) -c $(INSTBINFLAGS) program $(INSTALL_BIN_DIR)
385 #endif /* InstallBuildToolsScript */
388 * InstallPlatformBuildToolsScript - generate rules for installing
389 * scripts in platform specific directory.
391 #ifndef InstallPlatformBuildToolsScript
392 # define InstallPlatformBuildToolsScript(program) @@\
393 install_buildtools:: program @@\
394 MakeDir($(INSTALL_PLATFORM_ETC_DIR)) @@\
395 $(INSTALL) -c $(INSTBINFLAGS) program $(INSTALL_PLATFORM_ETC_DIR)
396 #endif /* InstallPlatformBuildToolsScript */
400 XCOMM only use this for files that are platform independent
401 XCOMM /* this is based upon InstallScript in Imake.rules */
403 #define InstallShellProg(progname) @@\
404 install:: progname @@\
405 MakeDir($(DESTDIR)$(INSTALL_BIN_DIR)) @@\
406 $(INSTALL) -c $(INSTBINFLAGS) progname $(DESTDIR)$(INSTALL_BIN_DIR)/progname
409 XCOMM don't depend on built-in .C.o rules
414 XCOMM forcing old C to be used