X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/blobdiff_plain/df897414c1663e7a3d3af7ed8c4b8d0fd342d55b..f111b4b2d7c5047a0c87281418a5283b0649987c:/util/imake.includes/Imake.rules diff --git a/util/imake.includes/Imake.rules b/util/imake.includes/Imake.rules index 75c68d89..d54f4a3d 100644 --- a/util/imake.includes/Imake.rules +++ b/util/imake.includes/Imake.rules @@ -7,11 +7,13 @@ #define concat(x,y) x##y #define concat3(x,y,z) x##y##z #define concat4(w,x,y,z) w##x##y##z +#define concat5(v,w,x,y,z) v##w##x##y##z #define requote(x) #x #else #define concat(x,y)x/**/y #define concat3(x,y,z)x/**/y/**/z #define concat4(w,x,y,z)w/**/x/**/y/**/z +#define concat5(v,w,x,y,z)v/**/w/**/x/**/y/**/z #define requote(x) "x" #endif @@ -66,7 +68,7 @@ concat3(lib,libname,_p.a): objs @@\ lint:: concat3(llib-l,libname,.ln) @@\ @@\ concat3(llib-l,libname,.ln): srcs @@\ - $(LINT) concat(-C,libname) $(CFLAGS) srcs lintlibs @@\ + $(LINT) concat(-C,libname) $(LINTFLAGS) srcs lintlibs @@\ @@\ clean:: @@\ $(RM) concat3(lib,libname,.a) concat3(lib,libname,_p.a) @@\ @@ -75,11 +77,13 @@ clean:: @@\ $(RM) profiled/?*.o @@\ @@\ install:: @@\ - $(INSTALLFILE) concat3(lib,libname,.a) concat4($(DESTDIR)$(LIBDIR)/,lib,libname,.a) @@\ - $(RANLIB) concat4($(DESTDIR)$(LIBDIR)/,lib,libname,.a) @@\ - $(INSTALLFILE) concat3(lib,libname,_p.a) concat4($(DESTDIR)$(LIBDIR)/,lib,libname,_p.a) @@\ - $(RANLIB) concat4($(DESTDIR)$(LIBDIR)/,lib,libname,_p.a) @@\ - $(INSTALLFILE) concat3(llib-l,libname,.ln) concat4($(DESTDIR)$(LIBDIR)/lint,llib-l,libname,.ln) @@\ + $(INSTALLRAW) -c -m 644 concat3(lib,libname,.a) concat4($(DESTDIR)$(LIBDIR)/,lib,libname,.a) @@\ + $(RANLIB) -t concat4($(DESTDIR)$(LIBDIR)/,lib,libname,.a) @@\ + $(CHMOD) 444 concat4($(DESTDIR)$(LIBDIR)/,lib,libname,.a) @@\ + $(INSTALLRAW) -c -m 644 concat3(lib,libname,_p.a) concat4($(DESTDIR)$(LIBDIR)/,lib,libname,_p.a) @@\ + $(RANLIB) -t concat4($(DESTDIR)$(LIBDIR)/,lib,libname,_p.a) @@\ + $(CHMOD) 444 concat4($(DESTDIR)$(LIBDIR)/,lib,libname,_p.a) @@\ + $(INSTALLFILE) concat3(llib-l,libname,.ln) concat4($(DESTDIR)$(LINTLIBDIR)/,llib-l,libname,.ln) @@\ #else /* !PROFILED_LIBS */ /* @@ -116,7 +120,7 @@ concat3(lib,libname,.a): objs @@\ lint:: concat3(llib-l,libname,.ln) @@\ @@\ concat3(llib-l,libname,.ln): srcs @@\ - $(LINT) concat(-C,libname) $(CFLAGS) srcs lintlibs @@\ + $(LINT) concat(-C,libname) $(LINTFLAGS) srcs lintlibs @@\ @@\ clean:: @@\ $(RM) concat3(lib,libname,.a) @@\ @@ -124,9 +128,10 @@ clean:: @@\ $(RM) objs @@\ @@\ install:: @@\ - $(INSTALLFILE) concat3(lib,libname,.a) concat4($(DESTDIR)$(LIBDIR)/,lib,libname,.a) @@\ + $(INSTALLRAW) -c -m 644 concat3(lib,libname,.a) concat4($(DESTDIR)$(LIBDIR)/,lib,libname,.a) @@\ $(RANLIB) -t concat4($(DESTDIR)$(LIBDIR)/,lib,libname,.a) @@\ - $(INSTALLFILE) concat3(llib-l,libname,.ln) concat4($(DESTDIR)$(LIBDIR)/lint,llib-l,libname,.ln) @@\ + $(CHMOD) 444 concat4($(DESTDIR)$(LIBDIR)/,lib,libname,.a) @@\ + $(INSTALLFILE) concat3(llib-l,libname,.ln) concat4($(DESTDIR)$(LINTLIBDIR)/,llib-l,libname,.ln) @@\ #endif /* PROFILED_LIBS */ @@ -137,7 +142,7 @@ install:: @@\ all:: pgm @@\ @@\ pgm: objs localdeps @@\ - $(CC) $(CFLAGS) -o $@ objs localdeps syslibs @@\ + $(CC) $(CFLAGS) -o $@ objs syslibs @@\ @@\ clean:: @@\ $(RM) pgm objs @@\ @@ -206,6 +211,12 @@ clean:: @@\ @@\ depend:: concat(src,.h) +#define mk_cmds(tbl) @@\ +concat(tbl,.o): concat(tbl,.ct) @@\ + $(MAKE_COMMANDS) concat(tbl,.ct) @@\ +clean:: @@\ + $(RM) concat(src,.o) + /* * Rule for building some random object module */ @@ -288,7 +299,7 @@ clean:: @@\ all:: pgm @@\ @@\ pgm: objs localdeps @@\ - $(CC) $(CFLAGS) -o $@ objs localdeps syslibs @@\ + $(CC) $(CFLAGS) -o $@ objs syslibs @@\ @@\ install:: @@\ $(INSTALLSUID) pgm ${DESTDIR}installdir/pgm @@\ @@ -304,7 +315,7 @@ clean:: @@\ all:: pgm @@\ @@\ pgm: objs localdeps @@\ - $(CC) $(CFLAGS) -o $@ objs localdeps syslibs @@\ + $(CC) $(CFLAGS) -o $@ objs syslibs @@\ @@\ install:: @@\ $(INSTALLRAW) instopts pgm ${DESTDIR}installdir/pgm @@\ @@ -312,6 +323,26 @@ install:: @@\ clean:: @@\ $(RM) pgm objs @@\ +/* + * Special rule for building and installing a Berkeley r-command + * We need to preserve the original copies upon installation. + */ + +#define ucbprogram(pgm,objs,localdeps,syslibs,installdir) @@\ +all:: pgm @@\ + @@\ +pgm: objs localdeps @@\ + $(CC) $(CFLAGS) -o $@ objs syslibs @@\ + @@\ +install:: @@\ + -if [ ! -f concat5(${DESTDIR},installdir,/,pgm,.ucb) -a -f concat4(${DESTDIR},installdir,/,pgm) ]; then \ @@\ + mv concat4(${DESTDIR},installdir,/,pgm) concat5(${DESTDIR},installdir,/,pgm,.ucb); fi; exit 0 @@\ + $(INSTALLSUID) pgm concat4(${DESTDIR},installdir,/,pgm) @@\ + @@\ +clean:: @@\ + $(RM) pgm objs @@\ + + /* * Rule for installing man pages. Section installing into should match * suffix, or the man page won't show up when using man(1). @@ -320,7 +351,7 @@ clean:: @@\ #define manpage(section,page) @@\ all:: @@\ install:: page @@\ - $(INSTALLFILE) page concat3(${DESTDIR}${MANDIR}/man,section,/`basename page`) @@\ + $(INSTALLFILE) page concat4(${DESTDIR}${MANDIR}/man,section,/,`basename page`) @@\ /* * Rule for building makefile dependencies. @@ -361,6 +392,7 @@ print:: ${CODE} @@\ src:: ${CODE} @@\ @@\ ${CODE}: @@\ + $(RM) $@ @@\ -$(LN) ${SRCDIR}/$@ $@ #define do_subdirs_no_imakefile(subdirs) @@\