5 #define concat(x,y) x##y
6 #define concat3(x,y,z) x##y##z
7 #define concat4(w,x,y,z) w##x##y##z
8 #define concat5(v,w,x,y,z) v##w##x##y##z
11 #define concat(x,y)x/**/y
12 #define concat3(x,y,z)x/**/y/**/z
13 #define concat4(w,x,y,z)w/**/x/**/y/**/z
14 #define concat5(v,w,x,y,z)v/**/w/**/x/**/y/**/z
15 #define requote(x) "x"
19 * Rule for building objects in libraries.
22 #define library_obj_rule() @@\
24 $(CC) -c $(CFLAGS) $*.c
26 #define install_library_target(libname,objs,srcs) @@\
28 all:: concat3(lib,libname,.a) @@\
30 concat3(lib,libname,.a): objs @@\
33 $(ARCHIVE) $@ objs @@\
37 $(RM) concat3(lib,libname,.a) @@\
41 $(INSTALLRAW) -c -m 644 concat3(lib,libname,.a) concat4($(DESTDIR)$(LIBDIR)/,lib,libname,.a) @@\
42 $(RANLIB) -t concat4($(DESTDIR)$(LIBDIR)/,lib,libname,.a) @@\
43 $(CHMOD) 444 concat4($(DESTDIR)$(LIBDIR)/,lib,libname,.a)
47 * Rule for building utilities (binaries which don't get installed)
49 #define genutil(pgm,objs,localdeps,syslibs) @@\
52 pgm: objs localdeps @@\
53 $(CC) $(CFLAGS) -o $@ objs syslibs $(OSLIBS) @@\
59 * Rule for building test programs (something which is not installed)
62 #define test_program(pgm,locallibs,syslibs) @@\
66 pgm: concat(pgm,.c) locallibs @@\
67 $(CC) $(CFLAGS) -o $@ $@.c locallibs syslibs $(OSLIBS) @@\
70 $(RM) pgm concat(pgm,.o) @@\
73 * Rule for compiling files with "et"
76 #define comp_et(tbl) @@\
77 concat(tbl,.h) concat(tbl,.c): concat(tbl,.et) @@\
78 $(COMPILE_ET) concat(tbl,.et) @@\
80 $(RM) concat(tbl,.c) concat(tbl,.h)
82 #define comp_et_depend(src) @@\
85 depend:: concat(src,.h)
88 * Rule for building a program which is to be installed:
91 #define program(pgm,objs,localdeps,syslibs,installdir) @@\
94 pgm: localdeps objs @@\
95 $(CC) $(CFLAGS) -o $@ objs syslibs $(OSLIBS) @@\
98 $(INSTALLPROG) pgm ${DESTDIR}installdir/pgm @@\
104 * Rule for installing man pages. Section installing into should match
105 * suffix, or the man page won't show up when using man(1).
108 #define manpage(section,page) @@\
111 $(INSTALLFILE) page concat4(${DESTDIR}${MANDIR}/man,section,/,`basename page`) @@\
114 * Rule for building makefile dependencies.
117 #define depend_target() @@\
119 @echo "### Now computing dependencies" @@\
120 @$(DEPEND) -s "# DO NOT DELETE" -- $(CFLAGS) -- $(SRCS) @@\
122 #define clean_target() @@\
124 $(RM) *~ \#* *.bak $(TAGSFILE)
126 #define makefile_target() @@\
128 -$(RM) Makefile.bak; $(MV) Makefile Makefile.bak @@\
129 $(IMAKE) -DNEW_TOP=$(NEWTOP) -s Makefile @@\
131 #define foreach_subdirs(name,subdirs) @@\
133 @for d in subdirs; \ @@\
135 (cd $$d; echo "### Making" name "in" `pwd`; \ @@\
136 $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) name ; \ @@\
137 echo "### Done with" `pwd`); \ @@\
140 #define src_target() @@\
145 -$(LN) ${SRCDIR}/$@ $@
147 #define do_subdirs_no_imakefile(subdirs) @@\
148 foreach_subdirs(all, subdirs) @@\
149 foreach_subdirs(install, subdirs) @@\
150 foreach_subdirs(clean, subdirs) @@\
151 foreach_subdirs(depend, subdirs) @@\
152 foreach_subdirs(src, subdirs) @@\
154 #define do_subdirs(subdirs) @@\
155 do_subdirs_no_imakefile(subdirs) @@\
158 @echo "### Making Makefiles in" `pwd` @@\
159 @for d in subdirs; \ @@\
161 (cd $$d; echo "### Making Makefile in" `pwd`; \ @@\
162 $(MAKE) $(MFLAGS) SRCTOP=$(SRCTOP) \ @@\
163 NEWTOP=../$(BUILDTOP) \ @@\
164 BUILDTOP=../$(BUILDTOP) \ @@\
167 $(MAKE) $(MFLAGS) SRCTOP=$(SRCTOP) \ @@\
168 NEWTOP=../$(BUILDTOP) \ @@\
170 echo "### Done with" `pwd`); \ @@\
174 /* Compile Embeded SQL source */
177 /* have to undef these to keep the ORADEFS line from being attacked by Imake */
182 ORADEFS= DEFINE=HESIOD DEFINE=ZEPHYR DEFINE=GDSS DEFINE=ATHENA
183 #define sqlrule() @@\
186 /usr/oracle/bin/proc INAME=$*.pc INCLUDE=$(BUILDTOP)/include INCLUDE=$(BUILDTOP)/lib INCLUDE=$(INCLDIR) $(ORADEFS)
187 #define sqlfile(file) @@\
188 concat(file,.c): concat(file,.pc) @@\
190 $(RM) concat(file,.c)