]> andersk Git - moira.git/blobdiff - util/imake.includes/Imake.rules
add -c to INSTALLRAW lines so that default action is forced to copy
[moira.git] / util / imake.includes / Imake.rules
index 75b1f915a1f6ff31acaafb4f245008ccd26e18ff..d54f4a3df728877879572d7663066ad594a2e3c8 100644 (file)
@@ -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
 
@@ -75,10 +77,10 @@ clean::                                                             @@\
        $(RM) profiled/?*.o                                             @@\
                                                                        @@\
 install::                                                              @@\
-       $(INSTALLRAW) -m 644 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)       @@\
        $(CHMOD) 444 concat4($(DESTDIR)$(LIBDIR)/,lib,libname,.a)       @@\
-       $(INSTALLRAW) -m 644 concat3(lib,libname,_p.a) concat4($(DESTDIR)$(LIBDIR)/,lib,libname,_p.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) @@\
@@ -126,10 +128,10 @@ clean::                                                           @@\
        $(RM) objs                                                      @@\
                                                                        @@\
 install::                                                              @@\
-       $(INSTALLRAW) -m 644 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)       @@\
        $(CHMOD) 444 concat4($(DESTDIR)$(LIBDIR)/,lib,libname,.a)       @@\
-       $(INSTALLFILE) concat3(llib-l,libname,.ln) concat4($(DESTDIR)$(LINTLIBBDIR)/,llib-l,libname,.ln)        @@\
+       $(INSTALLFILE) concat3(llib-l,libname,.ln) concat4($(DESTDIR)$(LINTLIBDIR)/,llib-l,libname,.ln) @@\
 
 #endif /* PROFILED_LIBS */
 
@@ -140,7 +142,7 @@ install::                                                           @@\
 all:: pgm                                                              @@\
                                                                        @@\
 pgm: objs localdeps                                                    @@\
-       $(CC) $(CFLAGS) -o $@ objs localdeps syslibs                    @@\
+       $(CC) $(CFLAGS) -o $@ objs syslibs                              @@\
                                                                        @@\
 clean::                                                                @@\
        $(RM) pgm objs                                                  @@\
@@ -209,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
  */
@@ -315,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).
This page took 0.080647 seconds and 4 git commands to generate.