]> andersk Git - moira.git/commitdiff
Add "ucbprogram" macro, plus support for it.
authorwesommer <wesommer>
Wed, 18 Jan 1989 21:06:35 +0000 (21:06 +0000)
committerwesommer <wesommer>
Wed, 18 Jan 1989 21:06:35 +0000 (21:06 +0000)
util/imake.includes/Imake.rules

index 75b1f915a1f6ff31acaafb4f245008ccd26e18ff..7aff9fc12ddc060ee8af2c32f9989edd4ce09df5 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
 
@@ -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                                                  @@\
@@ -315,6 +317,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.083119 seconds and 5 git commands to generate.