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