[omniORB] omniORB4 makefile changes to support parallel compilation

Teemu Torma tot@trema.com
Fri Nov 8 16:35:01 2002


--------------Boundary-00=_ADN9YWNLTY100GV2DS3B
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

If anyone is interested...

I made some changes to omniORB4 makefiles to make it possible to compile=20
it with GNU make's -j option to speed compilation.  These changes only=20
help autoconf version since that is what I am using.

Teemu

--------------Boundary-00=_ADN9YWNLTY100GV2DS3B
Content-Type: text/x-diff;
  charset="us-ascii";
  name="omniorb4-make.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="omniorb4-make.diff"

Index: mk/beforeauto.mk.in
===================================================================
RCS file: /trema/cvs/fk/tools/omniorb/mk/beforeauto.mk.in,v
retrieving revision 1.1.1.3
retrieving revision 1.9
diff -c -u -r1.1.1.3 -r1.9
--- mk/beforeauto.mk.in	24 Aug 2002 22:21:01 -0000	1.1.1.3
+++ mk/beforeauto.mk.in	1 Nov 2002 20:32:33 -0000	1.9
@@ -129,8 +129,7 @@
 #
 
 define MakeSubdirs
-(unset MAKEFLAGS; \
- set -e; \
++(set -e; \
  if [ "$$subdir_makeflags" = "" ]; then \
    subdir_makeflags='$(SUBDIR_MAKEFLAGS)'; \
  fi; \
@@ -153,6 +152,7 @@
 
 # Stop SUBDIRS specified on the command line being passed down.
 unexport SUBDIRS
+unexport TOP
 
 
 #############################################################################
Index: mk/mklib.mk
===================================================================
RCS file: /trema/cvs/fk/tools/omniorb/mk/mklib.mk,v
retrieving revision 1.1.1.4
retrieving revision 1.3
diff -c -u -r1.1.1.4 -r1.3
--- mk/mklib.mk	20 Mar 2002 14:56:28 -0000	1.1.1.4
+++ mk/mklib.mk	3 Nov 2002 15:36:14 -0000	1.3
@@ -43,14 +43,16 @@
 staticlib := static/$(patsubst %,$(LibNoDebugPattern),$(LIB_NAME)$(major))
 MDFLAGS += -p static/
 
-mkstatic::
-	@(dir=static; $(CreateDir))
+stmp-static: 
+	@(dir=static; $(CreateDir); touch $@)
 
 mkstatic:: $(staticlib)
 
 $(staticlib): $(patsubst %, static/%, $(LIB_OBJS))
 	@$(StaticLinkLibrary)
 
+$(patsubst %, static/%, $(LIB_OBJS)): stmp-static
+
 export:: $(staticlib)
 	@$(ExportLibrary)
 
@@ -60,11 +62,11 @@
 endif
 
 clean::
-	$(RM) static/*.o
+	$(RM) static/*.o stmp-static
 	$(RM) $(staticlib)
 
 veryclean::
-	$(RM) static/*.o
+	$(RM) static/*.o stmp-static
 	$(RM) $(staticlib)
 
 else
@@ -89,8 +91,8 @@
   imps := $(LIB_IMPORTS)
 endif
 
-mkshared::
-	@(dir=shared; $(CreateDir))
+stmp-shared:
+	@(dir=shared; $(CreateDir); touch $@)
 
 mkshared:: $(shlib)
 
@@ -98,6 +100,8 @@
 	@(namespec="$(namespec)" extralibs="$(imps)"; \
          $(MakeCXXSharedLibrary))
 
+$(patsubst %, shared/%, $(LIB_OBJS) $(LIB_SHARED_ONLY_OBJS)): stmp-shared
+
 export:: $(shlib)
 	@(namespec="$(namespec)"; \
           $(ExportSharedLibrary))
@@ -109,11 +113,11 @@
 endif
 
 clean::
-	$(RM) shared/*.o
+	$(RM) shared/*.o stmp-shared
 	(dir=shared; $(CleanSharedLibrary))
 
 veryclean::
-	$(RM) shared/*.o
+	$(RM) shared/*.o stmp-shared
 	@(dir=shared; $(CleanSharedLibrary))
 
 else
@@ -148,24 +152,26 @@
 dbuglib := debug/$(patsubst %,$(LibDebugPattern),$(LIB_NAME)$(major))
 MDFLAGS += -p debug/
 
-mkstaticdbug::
-	@(dir=debug; $(CreateDir))
+stmp-debug:
+	@(dir=debug; $(CreateDir); touch $@)
 
 mkstaticdbug:: $(dbuglib)
 
 $(dbuglib): $(patsubst %, debug/%, $(LIB_OBJS))
 	@$(StaticLinkLibrary)
 
+$(patsubst %, debug/%, $(LIB_OBJS)): stmp-debug
+
 export:: $(dbuglib)
 	@$(ExportLibrary)
 
 clean::
-	$(RM) debug/*.o
-	$(RM) $(dbuglib)
+	$(RM) debug/*.o 
+	$(RM) $(dbuglib) stmp-debug
 
 veryclean::
-	$(RM) debug/*.o
-	$(RM) $(dbuglib)
+	$(RM) debug/*.o 
+	$(RM) $(dbuglib) stmp-debug
 
 #####################################################
 #      DLL debug libraries
@@ -179,8 +185,8 @@
 dbugimps  := $(patsubst $(DLLNoDebugSearchPattern),$(DLLDebugSearchPattern), \
                $(LIB_IMPORTS))
 
-mkshareddbug::
-	@(dir=shareddebug; $(CreateDir))
+stmp-shareddebug:
+	@(dir=shareddebug; $(CreateDir); touch $@)
 
 mkshareddbug:: $(dbugshlib)
 
@@ -188,16 +194,19 @@
 	(namespec="$(namespec)" debug=1 extralibs="$(dbugimps)"; \
          $(MakeCXXSharedLibrary))
 
+$(patsubst %, shareddebug/%, $(LIB_OBJS) $(LIB_SHARED_ONLY_OBJS)): \
+		stmp-shareddebug
+
 export:: $(dbugshlib)
 	@(namespec="$(namespec)" debug=1; \
           $(ExportSharedLibrary))
 
 clean::
-	$(RM) shareddebug/*.o
+	$(RM) shareddebug/*.o stmp-shareddebug
 	@(dir=shareddebug; $(CleanSharedLibrary))
 
 veryclean::
-	$(RM) shareddebug/*.o
+	$(RM) shareddebug/*.o stmp-shareddebug
 	@(dir=shareddebug; $(CleanSharedLibrary))
 
 endif
Index: src/lib/omniORB/dir.mk
===================================================================
RCS file: /trema/cvs/fk/tools/omniorb/src/lib/omniORB/dir.mk,v
retrieving revision 1.1.1.2
retrieving revision 1.3
diff -c -u -r1.1.1.2 -r1.3
--- src/lib/omniORB/dir.mk	10 Mar 2002 15:46:52 -0000	1.1.1.2
+++ src/lib/omniORB/dir.mk	3 Nov 2002 15:36:13 -0000	1.3
@@ -66,28 +66,27 @@
 
 OMNIORB_IDL += -p$(BASE_OMNI_TREE)/src/lib/omniORB -Wbdebug
 
-omniORB4/distdate.hh : $(BASE_OMNI_TREE)/update.log
-	@(dir=omniORB4; $(CreateDir))
+omniORB4/distdate.hh : $(BASE_OMNI_TREE)/update.log stmp-omniORB4
 	$(PYTHON) $(BASE_OMNI_TREE)/bin/scripts/distdate.py <$(BASE_OMNI_TREE)/update.log >omniORB4/distdate.hh
 
-omniORB4/Naming.hh : Naming.idl
-	@(dir=omniORB4; $(CreateDir))
+omniORB4/Naming.hh : Naming.idl stmp-omniORB4
 	$(OMNIORB_IDL) -v -ComniORB4 $<
 
-omniORB4/bootstrap.hh : bootstrap.idl
-	@(dir=omniORB4; $(CreateDir))
+omniORB4/bootstrap.hh : bootstrap.idl stmp-omniORB4
 	$(OMNIORB_IDL) -v -ComniORB4 $<
 
-omniORB4/ir_defs.hh omniORB4/ir_operators.hh omniORB4/ir_poa.hh: ir.idl
-	@(dir=omniORB4; $(CreateDir))
+omniORB4/ir_defs.hh \
+omniORB4/ir_operators.hh \
+omniORB4/ir_poa.hh: ir.idl stmp-omniORB4
 	$(OMNIORB_IDL) -v -WbF $(IMPORT_IDLFLAGS) -ComniORB4 $<
 
-omniORB4/corbaidl_defs.hh corbaidl_operators.hh corbaidl_poa.hh: corbaidl.idl
-	@(dir=omniORB4; $(CreateDir))
+omniORB4/corbaidl_defs.hh \
+omniORB4/corbaidl_operators.hh \
+omniORB4/corbaidl_poa.hh: corbaidl.idl stmp-omniORB4
 	$(OMNIORB_IDL) -v -nf -P -WbF -ComniORB4 $<
 
 ciao:: $(STUBHEADERS)
 	@$(MakeSubdirs)
 
-
-
+stmp-omniORB4: 
+	@(dir=omniORB4; $(CreateDir); touch $@)
Index: src/lib/omnithread/dir.mk
===================================================================
RCS file: /trema/cvs/fk/tools/omniorb/src/lib/omnithread/dir.mk,v
retrieving revision 1.1.1.7
retrieving revision 5.8
diff -c -u -r1.1.1.7 -r5.8
--- src/lib/omnithread/dir.mk	24 Aug 2002 22:21:09 -0000	1.1.1.7
+++ src/lib/omnithread/dir.mk	3 Nov 2002 15:36:12 -0000	5.8
@@ -62,14 +62,16 @@
 
 staticlib := static/$(patsubst %,$(LibNoDebugPattern),$(LIB_NAME)$(major))
 
-mkstatic::
-	@(dir=static; $(CreateDir))
+stmp-static:
+	@(dir=static; $(CreateDir); touch $@)
 
 mkstatic:: $(staticlib)
 
 $(staticlib): $(patsubst %, static/%, $(LIB_OBJS))
 	@$(StaticLinkLibrary)
 
+$(patsubst %, static/%, $(LIB_OBJS)): stmp-static
+
 export:: $(staticlib)
 	@$(ExportLibrary)
 
@@ -79,11 +81,11 @@
 endif
 
 clean::
-	$(RM) static/*.o
+	$(RM) static/*.o stmp-static
 	$(RM) $(staticlib)
 
 veryclean::
-	$(RM) static/*.o
+	$(RM) static/*.o stmp-static
 	$(RM) $(staticlib)
 
 else
@@ -108,8 +110,8 @@
   imps := $(LIB_IMPORTS)
 endif
 
-mkshared::
-	@(dir=shared; $(CreateDir))
+stmp-shared:
+	@(dir=shared; $(CreateDir); touch $@)
 
 mkshared:: $(shlib)
 
@@ -117,6 +119,8 @@
 	@(namespec="$(namespec)" extralibs="$(imps)" nodeffile=1; \
          $(MakeCXXSharedLibrary))
 
+$(patsubst %, shared/%, $(LIB_OBJS)): stmp-shared
+
 export:: $(shlib)
 	@(namespec="$(namespec)"; \
           $(ExportSharedLibrary))
@@ -128,11 +132,11 @@
 endif
 
 clean::
-	$(RM) shared/*.o
+	$(RM) shared/*.o stmp-shared
 	(dir=shared; $(CleanSharedLibrary))
 
 veryclean::
-	$(RM) shared/*.o
+	$(RM) shared/*.o stmp-shared
 	@(dir=shared; $(CleanSharedLibrary))
 
 else
@@ -167,23 +171,25 @@
 
 dbuglib := debug/$(patsubst %,$(LibDebugPattern),$(LIB_NAME)$(major))
 
-mkstaticdbug::
-	@(dir=debug; $(CreateDir))
+stmp-staticdbug:
+	@(dir=debug; $(CreateDir); touch %@)
 
 mkstaticdbug:: $(dbuglib)
 
 $(dbuglib): $(patsubst %, debug/%, $(LIB_OBJS))
 	@$(StaticLinkLibrary)
 
+$(patsubst %, debug/%, $(LIB_OBJS)): stmp-staticdbug
+
 export:: $(dbuglib)
 	@$(ExportLibrary)
 
 clean::
-	$(RM) debug/*.o
+	$(RM) debug/*.o stmp-staticdbug
 	$(RM) $(dbuglib)
 
 veryclean::
-	$(RM) debug/*.o
+	$(RM) debug/*.o stmp-staticdbug
 	$(RM) $(dbuglib)
 
 #####################################################
@@ -197,8 +203,8 @@
 dbugimps  := $(patsubst $(DLLNoDebugSearchPattern),$(DLLDebugSearchPattern), \
                $(LIB_IMPORTS))
 
-mkshareddbug::
-	@(dir=shareddebug; $(CreateDir))
+stmp-shareddbug:
+	@(dir=shareddebug; $(CreateDir); touch $@)
 
 mkshareddbug:: $(dbugshlib)
 
@@ -206,16 +212,18 @@
 	(namespec="$(namespec)" debug=1 extralibs="$(dbugimps)" nodeffile=1; \
          $(MakeCXXSharedLibrary))
 
+$(patsubst %, shareddebug/%, $(LIB_OBJS)): stmp-shareddbug
+
 export:: $(dbugshlib)
 	@(namespec="$(namespec)" debug=1; \
           $(ExportSharedLibrary))
 
 clean::
-	$(RM) shareddebug/*.o
+	$(RM) shareddebug/*.o stmp-shareddbug
 	@(dir=shareddebug; $(CleanSharedLibrary))
 
 veryclean::
-	$(RM) shareddebug/*.o
+	$(RM) shareddebug/*.o stmp-shareddbug
 	@(dir=shareddebug; $(CleanSharedLibrary))
 
 endif
Index: src/services/mklib/dir.mk
===================================================================
RCS file: /trema/cvs/fk/tools/omniorb/src/services/mklib/dir.mk,v
retrieving revision 1.1.1.2
retrieving revision 1.3
diff -c -u -r1.1.1.2 -r1.3
--- src/services/mklib/dir.mk	10 Mar 2002 15:46:56 -0000	1.1.1.2
+++ src/services/mklib/dir.mk	3 Nov 2002 15:36:12 -0000	1.3
@@ -56,8 +56,8 @@
 dynsk = static/$(patsubst %,$(LibNoDebugPattern),$(COS_DYNSKLIB_NAME)$(version))
 MDFLAGS += -p static/
 
-mkstatic::
-	@(dir=static; $(CreateDir))
+stmp-static:
+	@(dir=static; $(CreateDir); touch $@)
 
 mkstatic:: $(sk) $(dynsk) 
 
@@ -67,6 +67,8 @@
 $(dynsk): $(patsubst %, static/%, $(COS_DYNSK_OBJS))
 	@$(StaticLinkLibrary)
 
+$(patsubst %, static/%, $(COS_SK_OBJS) $(COS_DYNSK_OBJS)): stmp-static
+
 export:: $(sk)
 	@$(ExportLibrary)
 
@@ -83,7 +85,7 @@
 
 
 clean::
-	$(RM) static/*.o
+	$(RM) static/*.o stmp-static
 	$(RM) $(sk) $(dynsk)
 
 else
@@ -119,9 +121,8 @@
 dynimps := $(OMNIORB_LIB)
 endif
 
-
-mkshared::
-	@(dir=shared; $(CreateDir))
+stmp-shared:
+	@(dir=shared; $(CreateDir); touch $@)
 
 mkshared:: $(skshared) $(dynskshared) 
 
@@ -129,10 +130,13 @@
 	@(namespec="$(sknamespec)" extralibs="$(imps)"; \
          $(MakeCXXSharedLibrary))
 
-$(dynskshared): $(patsubst %, shared/%, $(COS_DYNSK_OBJS))
+$(dynskshared): $(patsubst %, shared/%, $(COS_DYNSK_OBJS)) \
+		$(skshared)
 	@(namespec="$(dynsknamespec)" extralibs="$(skshared) $(dynimps)"; \
          $(MakeCXXSharedLibrary))
 
+$(patsubst %, shared/%, $(COS_SK_OBJS) $(COS_DYNSK_OBJS)): stmp-shared
+
 export:: $(skshared)
 	@(namespec="$(sknamespec)"; \
          $(ExportSharedLibrary))
@@ -152,7 +156,7 @@
 endif
 
 clean::
-	$(RM) shared/*.o
+	$(RM) shared/*.o stmp-shared
 	(dir=shared; $(CleanSharedLibrary))
 
 else
@@ -180,8 +184,8 @@
 
 MDFLAGS += -p debug/
 
-mkstaticdbug::
-	@(dir=debug; $(CreateDir))
+stmp-debug:
+	@(dir=debug; $(CreateDir); touch $@)
 
 mkstaticdbug:: $(skdbug) $(dynskdbug)
 
@@ -191,6 +195,8 @@
 $(dynskdbug): $(patsubst %, debug/%, $(COS_DYNSK_OBJS))
 	@$(StaticLinkLibrary)
 
+$(patsubst %, debug/%, $(COS_SK_OBJS) $(COS_DYNSK_OBJS)): stmp-debug
+
 export:: $(skdbug)
 	@$(ExportLibrary)
 
@@ -198,7 +204,7 @@
 	@$(ExportLibrary)
 
 clean::
-	$(RM) debug/*.o
+	$(RM) debug/*.o stmp-debug
 	$(RM) $(skdbug) $(dynskdbug)
 
 #####################################################
@@ -217,8 +223,8 @@
 
 MDFLAGS += -p shareddebug/
 
-mkshareddbug::
-	@(dir=shareddebug; $(CreateDir))
+stmp-shareddbug:
+	@(dir=shareddebug; $(CreateDir); touch $@)
 
 mkshareddbug:: $(skshareddbug) $(dynskshareddbug) 
 
@@ -226,10 +232,13 @@
 	(namespec="$(sknamespec)" debug=1 extralibs="$(dbugimps)"; \
          $(MakeCXXSharedLibrary))
 
-$(dynskshareddbug): $(patsubst %, shareddebug/%, $(COS_DYNSK_OBJS))
+$(dynskshareddbug): $(patsubst %, shareddebug/%, $(COS_DYNSK_OBJS)) \
+		    $(skshareddbug)
 	@(namespec="$(dynsknamespec)" debug=1 extralibs="$(skshareddbug) $(dbugimps)"; \
          $(MakeCXXSharedLibrary))
 
+$(patsubst %, shareddebug/%, $(COS_SK_OBJS) $(COS_DYNSK_OBJS)): stmp-shareddbug
+
 export:: $(skshareddbug)
 	@(namespec="$(sknamespec)" debug=1; \
          $(ExportSharedLibrary))
@@ -239,7 +248,7 @@
          $(ExportSharedLibrary))
 
 clean::
-	$(RM) shareddebug/*.o
+	$(RM) shareddebug/*.o stmp-shareddbug
 	@(dir=shareddebug; $(CleanSharedLibrary))
 
 endif
Index: src/services/mklib/libdefs.mk
===================================================================
RCS file: /trema/cvs/fk/tools/omniorb/src/services/mklib/libdefs.mk,v
retrieving revision 1.1.1.3
retrieving revision 1.2
diff -c -u -r1.1.1.3 -r1.2
--- src/services/mklib/libdefs.mk	24 Aug 2002 22:21:10 -0000	1.1.1.3
+++ src/services/mklib/libdefs.mk	1 Nov 2002 20:32:29 -0000	1.2
@@ -15,7 +15,7 @@
 
 DIR_CPPFLAGS = $(CORBA_CPPFLAGS) -D_COS_LIBRARY -DENABLE_CLIENT_IR_SUPPORT
 
-%.DynSK.cc %SK.cc: %.idl
+%DynSK.cc %SK.cc: %.idl
 	$(CORBA_IDL) $(DIR_IDLFLAGS) $^	
 
-.PRECIOUS: %.DynSK.cc %SK.cc
+.PRECIOUS: %DynSK.cc %SK.cc

--------------Boundary-00=_ADN9YWNLTY100GV2DS3B--