]> andersk Git - moira.git/blobdiff - util/imake.includes/Imake.rules
changed name of template file
[moira.git] / util / imake.includes / Imake.rules
index d54f4a3df728877879572d7663066ad594a2e3c8..b539067dbe1586b311ceb8de0f499627bdab7546 100644 (file)
  * Rule for building objects in libraries.
  */
 
+#ifdef mips
+/*
+ * The MIPS loader doesn't have the -X flag or its functionality.
+ */
+#define library_obj_rule()                                             @@\
+.c.o:                                                                  @@\
+       $(CC) PROF_FLAG -c $(CFLAGS) $*.c                               @@\
+       $(MV) $*.o profiled/$*.o                                        @@\
+       $(CC) -c $(CFLAGS) $*.c                                         @@\
+       -$(LD) -x -r -o a.out $*.o                                      @@\
+       $(MV) a.out $*.o
+#else /* ! mips */
 #define library_obj_rule()                                             @@\
 .c.o:                                                                  @@\
        $(CC) PROF_FLAG -c $(CFLAGS) $*.c                               @@\
@@ -29,7 +41,7 @@
        $(CC) -c $(CFLAGS) $*.c                                         @@\
        -$(LD) -x -r -o a.out $*.o                                      @@\
        $(MV) a.out $*.o
-
+#endif /* mips */
 /*
  * cc -R breaks profiling with -p on 4.3BSD on the VAX 
  * (and probably elsewhere), so we don't do it for the profiled version.
@@ -58,17 +70,21 @@ all:: concat3(lib,libname,.a) concat3(lib,libname,_p.a)                     @@\
 all:: concat3(llib-l,libname,.ln)                                      @@\
                                                                        @@\
 concat3(lib,libname,.a): objs                                          @@\
+       $(RM) $@.bak                                                    @@\
+       -$(MV) $@ $@.bak                                                @@\
        $(ARCHIVE) $@ objs                                              @@\
        $(RANLIB) $@                                                    @@\
                                                                        @@\
 concat3(lib,libname,_p.a): objs                                                @@\
+       $(RM) $@.bak                                                    @@\
+       -$(MV) $@ $@.bak                                                @@\
        cd profiled; $(ARCHIVE) ../$@ objs                              @@\
        $(RANLIB) $@                                                    @@\
                                                                        @@\
 lint:: concat3(llib-l,libname,.ln)                                     @@\
                                                                        @@\
 concat3(llib-l,libname,.ln): srcs                                      @@\
-       $(LINT) concat(-C,libname) $(LINTFLAGS) srcs lintlibs           @@\
+       $(LINT) concat($(LINTLIBFLAG),libname) $(LINTFLAGS) srcs lintlibs               @@\
                                                                        @@\
 clean::                                                                @@\
        $(RM) concat3(lib,libname,.a) concat3(lib,libname,_p.a)         @@\
@@ -90,11 +106,18 @@ install::                                                          @@\
  * Rule for building objects in libraries.
  */
 
+#ifdef DEBUG_LIBS
+/* When debugging, leave symbols alone (don't do LD) */
+#define library_obj_rule()                                             @@\
+.c.o:                                                                  @@\
+       $(CC) -c $(CFLAGS) $*.c
+#else
 #define library_obj_rule()                                             @@\
 .c.o:                                                                  @@\
        $(CC) -c $(CFLAGS) $*.c                                         @@\
        -$(LD) -x -r -o a.out $*.o                                      @@\
        $(MV) a.out $*.o
+#endif
 
 #define library_ro_object(cfile)                                       @@\
 concat(cfile,.o): concat(cfile,.c)                                     @@\
@@ -114,13 +137,15 @@ all:: concat3(lib,libname,.a)                                             @@\
 all:: concat3(llib-l,libname,.ln)                                      @@\
                                                                        @@\
 concat3(lib,libname,.a): objs                                          @@\
+       $(RM) $@.bak                                                    @@\
+       -$(MV) $@ $@.bak                                                @@\
        $(ARCHIVE) $@ objs                                              @@\
        $(RANLIB) $@                                                    @@\
                                                                        @@\
 lint:: concat3(llib-l,libname,.ln)                                     @@\
                                                                        @@\
 concat3(llib-l,libname,.ln): srcs                                      @@\
-       $(LINT) concat(-C,libname) $(LINTFLAGS) srcs lintlibs           @@\
+       $(LINT) concat($(LINTLIBFLAG),libname) $(LINTFLAGS) srcs lintlibs               @@\
                                                                        @@\
 clean::                                                                @@\
        $(RM) concat3(lib,libname,.a)                                   @@\
@@ -194,8 +219,8 @@ concat(tbl,.h) concat(tbl,.o): concat(tbl,.et)                              @@\
        $(MV) concat(tbl,.et.o) concat3(profiled/,tbl,.o)               @@\
        $(COMPILE_ET) concat(tbl,.et)                                   @@\
 clean::                                                                        @@\
-       $(RM) concat(src,.o) concat(src,.h)                             @@\
-depend:: concat(src,.h)
+       $(RM) concat(tbl,.o) concat(tbl,.h)                             @@\
+depend:: concat(tbl,.h)
 #else /* !PROFILED_LIBS */
 #define comp_et_prof(tbl) comp_et(tbl)
 #endif /* PROFILED_LIBS */
@@ -204,10 +229,10 @@ depend:: concat(src,.h)
 concat(tbl,.h) concat(tbl,.o): concat(tbl,.et)                         @@\
        $(COMPILE_ET) concat(tbl,.et)                                   @@\
 clean::                                                                        @@\
-       $(RM) concat(src,.o) concat(src,.h)
+       $(RM) concat(tbl,.o) concat(tbl,.h)
 
 #define comp_et_depend(src)                                            @@\
-       comp_et(src)                                                    @@\
+       comp_et_prof(src)                                               @@\
                                                                        @@\
 depend:: concat(src,.h)
 
@@ -215,7 +240,7 @@ depend:: concat(src,.h)
 concat(tbl,.o): concat(tbl,.ct)                                                @@\
        $(MAKE_COMMANDS) concat(tbl,.ct)                                @@\
 clean::                                                                        @@\
-       $(RM) concat(src,.o)
+       $(RM) concat(tbl,.o)
 
 /*
  * Rule for building some random object module
@@ -360,7 +385,7 @@ install:: page                                                              @@\
 #define        depend_target()                                                 @@\
 depend:: $(SRCS)                                                       @@\
        @echo "### Now computing dependencies"                          @@\
-       @$(DEPEND) -s "# DO NOT DELETE" $(CFLAGS) $(SRCS)               @@\
+       @$(DEPEND) -s "# DO NOT DELETE" -- $(CFLAGS) -- $(SRCS)         @@\
 
 #define clean_target()                                                 @@\
 clean::                                                                        @@\
This page took 0.038636 seconds and 4 git commands to generate.