DtInfo.rules 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. XCOMM $TOG: DtInfo.rules /main/21 1997/09/05 11:31:01 samborn $
  2. /* Note whether we are the top level project. */
  3. #ifndef SeenTopLevelProject
  4. # define SeenTopLevelProject YES
  5. # define DtInfoIsTopLevelProject YES
  6. #else
  7. # define DtInfoIsTopLevelProject NO
  8. #endif
  9. /* Chain project rules files. */
  10. #include <cde.rules>
  11. /* Include our favorites in PROJECT_DEFINES. */
  12. #ifndef DtInfoProjectDefines
  13. # define DtInfoProjectDefines $(DTINFO_DEFINES) $(WIDEC_DEFINES) $(I18N_DEFINES) $(SEARCH_DEFINES) $(DLOPEN_DEFINES) $(LM_DEFINES) $(BYTE_ORDER_DEFINES)
  14. #endif
  15. #ifdef ProjectDefines
  16. # undef ProjectDefines
  17. #endif
  18. #define ProjectDefines \
  19. X11ProjectDefines MotifProjectDefines CdeProjectDefines DtInfoProjectDefines
  20. /* Ditto for CXXPROJECT_DEFINES. */
  21. #ifndef DtInfoCplusplusProjectDefines
  22. # define DtInfoCplusplusProjectDefines DtInfoProjectDefines
  23. #endif
  24. #ifdef CplusplusProjectDefines
  25. # undef CplusplusProjectDefines
  26. #endif
  27. #define CplusplusProjectDefines \
  28. X11CplusplusProjectDefines MotifCplusplusProjectDefines CdeCplusplusProjectDefines DtInfoCplusplusProjectDefines
  29. /*
  30. * library building stuff
  31. */
  32. #if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 5
  33. # define makelibT(libname) @@\
  34. makelib(libname) @@\
  35. @@\
  36. Concat3(libname/lib,libname,T.a): FRC @@\
  37. @(cd libname ; \ @@\
  38. echo STR(*** Making lib libname Templates ***) ; \ @@\
  39. $(MAKE) Concat3(lib,libname,T.a) ; \ @@\
  40. )
  41. # define makelibsubsubdir(subdir,libname) @@\
  42. @@\
  43. Concat(subdir/libname/lib,libname.a): FRC @@\
  44. @(cd subdir ; \ @@\
  45. echo STR(*** Making lib libname ***) ; \ @@\
  46. $(MAKE) Concat(libname/lib,libname.a) ; \ @@\
  47. )
  48. # define makelibTsubsubdir(subdir,libname) @@\
  49. @@\
  50. Concat3(subdir/libname/lib,libname,T.a): FRC @@\
  51. @(cd subdir ; \ @@\
  52. echo STR(*** Making lib libname Templates ***) ; \ @@\
  53. $(MAKE) Concat3(libname/lib,libname,T.a) ; \ @@\
  54. )
  55. #else /* not defined(SunArchitecture) && CplusplusCompilerMajorVersion > 5 */
  56. # define makelibT(libname) @@\
  57. makelib(libname)
  58. #endif
  59. #define makelib(libname) @@\
  60. makelibd(libname,)
  61. #define makelibd(libname, deps) @@\
  62. Concat(libname/lib,libname.a): deps FRC @@\
  63. @(cd libname; \ @@\
  64. echo STR(*** Making lib libname ***) ; \ @@\
  65. $(MAKE) Concat(lib,libname.a) ; \ @@\
  66. if [ -d "$(TEMPLATE_DB)" ]; then \ @@\
  67. $(MAKE) Concat3(lib,libname,T.a) ; \ @@\
  68. fi \ @@\
  69. ) @@\
  70. libname/libname.d: libname/Classlist.mk @@\
  71. @(cd libname; \ @@\
  72. echo STR(*** Making dfiles in libname ***) ; \ @@\
  73. $(MAKE) libname.d ;\ @@\
  74. ) @@\
  75. libname/libname.h: libname/Classlist.mk @@\
  76. @(cd libname; \ @@\
  77. echo STR(*** Making dfiles in libname ***) ; \ @@\
  78. $(MAKE) libname.h ;\ @@\
  79. ) @@\
  80. libname/libname.msg: libname/Classlist.mk @@\
  81. @(cd libname; \ @@\
  82. echo STR(*** Making msgs in libname ***) ; \ @@\
  83. $(MAKE) libname.msg ;\ @@\
  84. ) @@\
  85. @@\
  86. FRC: @@\
  87. XCOMM
  88. XCOMM makes toplevel Prelude.h
  89. XCOMM
  90. #define make_prelude(libraries, deps) @@\
  91. Prelude.h: deps @@\
  92. @$(RM) $@ @@\
  93. $(OLIAS)/tools/misc/pmaker libraries
  94. XCOMM
  95. XCOMM build .d and .h files within a library
  96. XCOMM
  97. #define make_libfiles(library,classes) @@\
  98. dfiles:: Concat(library,.d) Concat(library,.h) @@\
  99. Concat(library,.d) : Classlist.mk @@\
  100. $(RM) $@ @@\
  101. $(OLIAS)/tools/misc/dfiles d library classes @@\
  102. Concat(library,.h) : Classlist.mk @@\
  103. $(RM) $@ @@\
  104. $(OLIAS)/tools/misc/dfiles h library classes @@\
  105. clean:: @@\
  106. $(RM) Concat(library,.d) Concat(library,.h)
  107. #define make_msgs(library, msgs) @@\
  108. messages:: Concat(library,.msg) @@\
  109. Concat(library,.msg) : Classlist.mk msgs @@\
  110. $(RM) $@ @@\
  111. cat msgs > Concat(library,.msg) @@\
  112. clean:: @@\
  113. $(RM) Concat(library,.msg)
  114. XCOMM Build a library
  115. XCOMM *NOTE* SimpleLibrary does *not* build a real ar-style
  116. XCOMM library; it merely uses ld -r -o to concatenate a set
  117. XCOMM of .o's together. Use RealLibrary to build an honest-
  118. XCOMM -to-gosh ranlib'd library. Unless you really need true
  119. XCOMM library behavior (partial selection of contents, etc.),
  120. XCOMM SimpleLibrary is the better choice.
  121. #define SimpleLibraryWithAddedObjs(libname,objlist,libdir,objlist1) @@\
  122. AllTarget(Concat(lib,libname.a)) @@\
  123. @@\
  124. Concat(lib,libname.a): objlist @@\
  125. $(RM) $@ @@\
  126. @echo "### Making SimpleLibraryWithAddedObjs libname.a" @@\
  127. $(LD) -r -o $@ objlist objlist1
  128. #define SimpleLibrary(libname,objlist,libdir) @@\
  129. AllTarget(Concat(lib,libname.a)) @@\
  130. @@\
  131. Concat(lib,libname.a): objlist @@\
  132. $(RM) $@ @@\
  133. @echo STR(*** Making SimpleLibrary libname.a) @@\
  134. $(LD) -r -o $@ objlist
  135. #if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 5
  136. #define SimpleLibraryT(libname,objlist,libdir) @@\
  137. SimpleLibrary(libname,objlist,libdir) @@\
  138. @@\
  139. AllTarget(Concat3(lib,libname,T.a)) @@\
  140. @@\
  141. Concat3(lib,libname,T.a): @@\
  142. $(RM) $@ @@\
  143. @echo STR(*** Making SimpleLibraryT libname Templates) @@\
  144. find ./Templates.DB -name '*.o' -type f -print | xargs -n4 ar cq $@ @@\
  145. @@\
  146. clean:: @@\
  147. ptclean
  148. #else
  149. #define SimpleLibraryT(libname,objlist,libdir) @@\
  150. SimpleLibrary(libname,objlist,libdir) @@\
  151. @@\
  152. AllTarget(Concat3(lib,libname,T.a)) @@\
  153. @@\
  154. Concat3(lib,libname,T.a): TemplateObjs @@\
  155. $(RM) $@ @@\
  156. @echo STR(*** Making SimpleLibraryT libname Templates) @@\
  157. $(AR) $@ TemplateObjs @@\
  158. @@\
  159. clean:: @@\
  160. $(RM) -r $(TEMPLATE_DB)
  161. #endif
  162. #define RealLibrary(libname,objlist,libdir) @@\
  163. AllTarget(Concat(lib,libname.a)) @@\
  164. @@\
  165. Concat(lib,libname.a): objlist @@\
  166. $(RM) $@ @@\
  167. @echo STR(*** Making RealLibrary libname.a) @@\
  168. ar cq $@ objlist @@\
  169. RanLibrary($@)
  170. #define NotSoSimpleLibrary(libname,objlist,libdir,otherdeps) @@\
  171. AllTarget(Concat(lib,libname.a)) @@\
  172. @@\
  173. Concat(lib,libname.a): objlist otherdeps @@\
  174. $(RM) $@ @@\
  175. @echo STR(*** Making NotSoSimpleLibrary libname.a) @@\
  176. $(LD) -r -o $@ objlist
  177. #if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 5
  178. #define NotSoSimpleLibraryT(libname,objlist,libdir,otherdeps) @@\
  179. NotSoSimpleLibrary(libname,objlist,libdir,otherdeps) @@\
  180. @@\
  181. AllTarget(Concat3(lib,libname,T.a)) @@\
  182. @@\
  183. Concat3(lib,libname,T.a): @@\
  184. $(RM) $@ @@\
  185. @echo STR(*** Making NotSoSimpleLibraryT libname Templates) @@\
  186. find ./Templates.DB -name '*.o' -type f -print | xargs -n4 ar cq $@ @@\
  187. @@\
  188. clean:: @@\
  189. ptclean
  190. #else
  191. #define NotSoSimpleLibraryT(libname,objlist,libdir,otherdeps) @@\
  192. NotSoSimpleLibrary(libname,objlist,libdir,otherdeps) @@\
  193. @@\
  194. AllTarget(Concat3(lib,libname,T.a)) @@\
  195. @@\
  196. Concat3(lib,libname,T.a): @@\
  197. $(RM) $@ @@\
  198. @echo STR(*** Making NotSoSimpleLibraryT libname Templates) @@\
  199. $(AR) $@ TemplateObjs @@\
  200. @@\
  201. clean:: @@\
  202. $(RM) -r $(TEMPLATE_DB)
  203. #endif
  204. #define do_subdirs_imakefile(subdirs) /* nothing */
  205. #define do_subdirs(subdirs) /* nothing */
  206. #define foreach_subdirs(name, subdirs) @@\
  207. NamedTargetSubdirs(name,subdirs,name,NullParameter,name)
  208. /* Yacc and Lex Support */
  209. #define SimpleCPlusPlusLexTarget(lexname) @@\
  210. lexname.o : lexname.l @@\
  211. $(RM) lexname.C @@\
  212. $(FLEX) $(LFLAGS) -t lexname.l > lexname.C @@\
  213. $(CXX) -c $(CXXFLAGS) lexname.C
  214. #define LexTarget(lexname, parsename) @@\
  215. lexname.o : lexname.l @@\
  216. $(RM) lexname.C lex.yy.c lexname.o @@\
  217. $(FLEX) $(LFLAGS) lexname.l @@\
  218. sed 's/yy/parsename/g' lex.yy.c | sed 's/YY/parsename/g' > lexname.C @@\
  219. $(CXX) -c $(CXXFLAGS) lexname.C @@\
  220. $(RM) lexname.C lex.yy.c
  221. #define YaccTarget(file, parser) @@\
  222. file.o: file.y @@\
  223. $(RM) file.tab.h file.C y.tab.h y.tab.c file.o @@\
  224. $(BYACC) $(YFLAGS) file.y @@\
  225. sed 's/yy/parser/g' y.tab.h > file.tab.h @@\
  226. sed 's/yy/parser/g' y.tab.c | sed 's/YY/parser/g' > file.C @@\
  227. $(CXX) $(CXXFLAGS) -c file.C @@\
  228. $(RM) file.C y.tab.h y.tab.c
  229. /*
  230. * C++ Support (from here down...)
  231. */
  232. /*
  233. * On hp, *..c files need to be removed
  234. */
  235. #ifdef HPArchitecture
  236. # define CplusObjectCompile(options) $(RM) $*..c $*.o $*.prep @@\
  237. ObjectCplusplusCompile(options)
  238. #else /* not defined(HPArchitecture) */
  239. # define CplusObjectCompile(options) ObjectCplusplusCompile(options)
  240. #endif
  241. #define CplusIntermediateCompile(options) $(RM) $@ @@\
  242. $(CXX) +i -c $(CXXFLAGS) options `basename $@ .c`CCsuf
  243. /* need to remove this and "C++*", and use default from r6, with "CXX*": */
  244. #ifdef NormalCplusplusObjectRule
  245. # undef NormalCplusplusObjectRule
  246. #endif
  247. #define NormalCplusplusObjectRule() @@\
  248. .SUFFIXES: .C .o @@\
  249. @@\
  250. .C.o: @@\
  251. CplusObjectCompile($(_NOOP_))
  252. #define HPchatr(program) @@\
  253. install:: @@\
  254. chatr +s enable program
  255. /*
  256. * Total bogosity with error codes:
  257. * if [ `chatr $@ | grep 'libftft'` -gt 0 ] ; then \ @@\
  258. * chatr -l `chatr $@ | grep 'libftft' | \ @@\
  259. * sed -e 's|[^/]*\(/VOB/.*\)|\1|'` +s enable $@;\ @@\
  260. * fi @@\
  261. * echo "chatr checked" @@\
  262. */
  263. #define ComplexCPlusPlusProgram(program) @@\
  264. PROGRAM = program @@\
  265. @@\
  266. AllTarget(program) @@\
  267. @@\
  268. program: $(OBJS) $(DEPLIBS) @@\
  269. RemoveTargetProgram($@) @@\
  270. $(CXXLINK) -o $@ $(OBJS) $(CXXLDOPTIONS) $(STATIC) $(LOCAL_LIBRARIES) $(EXTRA_LOAD_FLAGS) $(EXTRA_LIBRARIES) $(SYS_LIBRARIES) @@\
  271. @@\
  272. clean:: @@\
  273. $(RM) $(PROGRAM) @@\
  274. #define CPlusPlusProgram(program,objects,libs) @@\
  275. program: objects @@\
  276. RemoveTargetProgram($@) @@\
  277. $(CXXLINK) -o $@ objects $(CXXLDOPTIONS) $(STATIC) libs $(LDLIBS) $(EXTRA_LOAD_FLAGS) $(EXTRA_LIBRARIES) @@\
  278. @@\
  279. clean:: @@\
  280. $(RM) program
  281. #define SimpleCPlusPlusProgram(program,objects,libs) @@\
  282. AllTarget(program) @@\
  283. CPlusPlusProgram(program,objects,libs)
  284. #define SpecialCPlusPlusObjectRule(objs,depends,options) @@\
  285. objs: depends @@\
  286. CplusObjectCompile(options) @@\
  287. @@\
  288. clean:: @@\
  289. $(RM) *..c
  290. #define SpecialCPlusPlusExpandRule(expn,depends,options) @@\
  291. expn: depends @@\
  292. CplusIntermediateCompile(options)
  293. XCOMM
  294. XCOMM CProgram is required by C modules in build-tools
  295. XCOMM
  296. #define CProgram(program,objects,libs) @@\
  297. program: objects @@\
  298. RemoveTargetProgram($@) @@\
  299. $(CCLINK) -o $@ objects $(LDOPTIONS) $(STATIC) libs $(LDLIBS) $(EXTRA_LOAD_FLAGS) $(EXTRA_LIBRARIES) @@\
  300. @@\
  301. clean:: @@\
  302. $(RM) program
  303. XCOMM
  304. XCOMM SimpleCProgram is required by the C modules in buildtools to build
  305. XCOMM statically
  306. XCOMM
  307. #define SimpleCProgram(program,objects,libs) @@\
  308. AllTarget(program) @@\
  309. CProgram(program,objects,libs)
  310. XCOMM
  311. XCOMM platform dependent executables, shell scripts
  312. XCOMM
  313. #define InstallLibFile(filename) @@\
  314. InstallNonExecFile(filename,$(INSTALL_LIB_DIR))
  315. XCOMM The following macros are used by the build tools
  316. /*
  317. * InstallBuildToolsBinary - generate rules to install an executable
  318. * program in build tools.
  319. */
  320. #ifndef InstallBuildToolsBinary
  321. # define InstallBuildToolsBinary(program) @@\
  322. install_buildtools:: @@\
  323. MakeDir($(INSTALL_PLATFORM_ETC_DIR)) @@\
  324. $(INSTALL) -c $(INSTPGMFLAGS) program $(INSTALL_PLATFORM_ETC_DIR)
  325. #endif /* InstallBuildToolsBinary */
  326. /*
  327. * InstallBuildToolsScript - generate rules for installing scripts
  328. */
  329. #ifndef InstallBuildToolsScript
  330. # define InstallBuildToolsScript(program) @@\
  331. install_buildtools:: program @@\
  332. MakeDir($(INSTALL_BIN_DIR)) @@\
  333. $(INSTALL) -c $(INSTBINFLAGS) program $(INSTALL_BIN_DIR)
  334. #endif /* InstallBuildToolsScript */
  335. /*
  336. * InstallPlatformBuildToolsScript - generate rules for installing
  337. * scripts in platform specific directory.
  338. */
  339. #ifndef InstallPlatformBuildToolsScript
  340. # define InstallPlatformBuildToolsScript(program) @@\
  341. install_buildtools:: program @@\
  342. MakeDir($(INSTALL_PLATFORM_ETC_DIR)) @@\
  343. $(INSTALL) -c $(INSTBINFLAGS) program $(INSTALL_PLATFORM_ETC_DIR)
  344. #endif /* InstallPlatformBuildToolsScript */
  345. XCOMM
  346. XCOMM only use this for files that are platform independent
  347. XCOMM /* this is based upon InstallScript in Imake.rules */
  348. XCOMM
  349. #define InstallShellProg(progname) @@\
  350. install:: progname @@\
  351. MakeDir($(DESTDIR)$(INSTALL_BIN_DIR)) @@\
  352. $(INSTALL) -c $(INSTBINFLAGS) progname $(DESTDIR)$(INSTALL_BIN_DIR)/progname
  353. XCOMM
  354. XCOMM don't depend on built-in .C.o rules
  355. XCOMM
  356. XCOMM
  357. XCOMM forcing old C to be used
  358. XCOMM