*** /NextDeveloper/Makefiles/app/common.make	Wed Jul 14 15:08:37 1993
--- common.make	Mon Feb 27 10:25:05 1995
***************
*** 10,20 ****
  #  
  ###############################################################################
  
  
  all::
  
! SUPPORTFILES = IB.nproj Makefile makefile $(NAME).iconheader \
! 	Makefile.preamble Makefile.postamble *.project SGS_ENV
  
  SRCFILES = $(CLASSES) \
  	$(MFILES) $(CFILES) $(CCFILES) $(CAPCFILES) $(CXXFILES) $(CPPFILES) \
--- 10,20 ----
  #  
  ###############################################################################
  
+ CC = gcc
  
  all::
  
! SUPPORTFILES = IB.nproj MakefileX *.project SGS_ENV
  
  SRCFILES = $(CLASSES) \
  	$(MFILES) $(CFILES) $(CCFILES) $(CAPCFILES) $(CXXFILES) $(CPPFILES) \
***************
*** 28,35 ****
  SRCROOT = .
  SYMROOT = .
  OBJROOT = .
! RC_ARCHS = `/usr/bin/arch`
! RC_CFLAGS = -arch `/usr/bin/arch`
  
  # Directory for .o files (can be thrown away) 
  OFILE_DIR = $(OBJROOT)/$(ARCH_LIST)obj
--- 28,35 ----
  SRCROOT = .
  SYMROOT = .
  OBJROOT = .
! RC_ARCHS = `$(MAKEFILEDIR)/architecture`
! RC_CFLAGS =
  
  # Directory for .o files (can be thrown away) 
  OFILE_DIR = $(OBJROOT)/$(ARCH_LIST)obj
***************
*** 40,46 ****
  DERIVED_SRC_DIR = $(SYM_DIR)
  
  $(OFILE_DIR) $(SYM_DIR):
! 	@$(MKDIRS) $@
  
  MSGOFILES = $(MSGFILES:.msg=Speaker.o) $(MSGFILES:.msg=Listener.o)
  MSGDERIVEDMFILES = $(MSGFILES:.msg=Speaker.m) $(MSGFILES:.msg=Listener.m)
--- 40,48 ----
  DERIVED_SRC_DIR = $(SYM_DIR)
  
  $(OFILE_DIR) $(SYM_DIR):
! 	@(if [ ! -d  $@ ] ; then \
! 		$(MKDIRS) $@ ; \
! 	fi)
  
  MSGOFILES = $(MSGFILES:.msg=Speaker.o) $(MSGFILES:.msg=Listener.o)
  MSGDERIVEDMFILES = $(MSGFILES:.msg=Speaker.m) $(MSGFILES:.msg=Listener.m)
***************
*** 76,82 ****
  
  # Default extension for bundles (directories containing object code and resources)
  
! MAKEFILES = Makefile
  
  PRODUCT_DEPENDS = $(OFILES) $(OTHER_OFILES) $(DBMODELS) \
  	$(ICONHEADER) $(APPICON) $(DOCICONS) $(MAKEFILES) \
--- 78,84 ----
  
  # Default extension for bundles (directories containing object code and resources)
  
! MAKEFILES = MakefileX
  
  PRODUCT_DEPENDS = $(OFILES) $(OTHER_OFILES) $(DBMODELS) \
  	$(ICONHEADER) $(APPICON) $(DOCICONS) $(MAKEFILES) \
***************
*** 84,95 ****
  
  GARBAGE = $(PSWFILES:.psw=.c) $(PSWMFILES:.pswm=.m) \
  	$(PSWFILES:.psw=.h) $(PSWMFILES:.pswm=.m) \
! 	$(SYMROOT)/$(NAME).app $(SYMROOT)/$(NAME).debug \
! 	$(SYMROOT)/$(NAME).profile $(SYMROOT)/$(NAME).$(BUNDLE_EXTENSION) \
  	$(SYMROOT)/$(NAME) $(SYMROOT)/$(NAME).palette \
! 	$(OBJROOT)/*_obj $(SYM_DIR) *~ $(LANGUAGE).lproj/*~ \
! 	Makefile.dependencies $(OTHER_GARBAGE) gmon.out \
! 	$(PRECOMPS) $(OTHER_INITIAL_TARGETS)
  
  # Default name for file to use as "reference time of last build"
  CHANGES_FILE = .lastBuildTime
--- 86,96 ----
  
  GARBAGE = $(PSWFILES:.psw=.c) $(PSWMFILES:.pswm=.m) \
  	$(PSWFILES:.psw=.h) $(PSWMFILES:.pswm=.m) \
! 	$(SYMROOT)/$(NAME).Xapp $(SYMROOT)/$(NAME).Xdebug \
! 	$(SYMROOT)/$(NAME).Xprofile $(SYMROOT)/$(NAME).$(BUNDLE_EXTENSION) \
  	$(SYMROOT)/$(NAME) $(SYMROOT)/$(NAME).palette \
! 	$(OBJROOT)/*obj $(SYM_DIR) *~ $(LANGUAGE).lproj/*~ \
! 	$(OTHER_GARBAGE) gmon.out $(PRECOMPS) $(OTHER_INITIAL_TARGETS)
  
  # Default name for file to use as "reference time of last build"
  CHANGES_FILE = .lastBuildTime
***************
*** 103,109 ****
  NORMAL_CFLAGS = -g $(OPTIMIZATION_CFLAG) -Wall
  DEBUG_CFLAGS = -g -Wall -DDEBUG
  PROFILE_CFLAGS = -g -pg $(OPTIMIZATION_CFLAG) -Wall -DPROFILE
! OBJCFLAG = -ObjC
  C++CFLAGS = 
  
  # Defaults strip options
--- 104,110 ----
  NORMAL_CFLAGS = -g $(OPTIMIZATION_CFLAG) -Wall
  DEBUG_CFLAGS = -g -Wall -DDEBUG
  PROFILE_CFLAGS = -g -pg $(OPTIMIZATION_CFLAG) -Wall -DPROFILE
! OBJCFLAG =
  C++CFLAGS = 
  
  # Defaults strip options
***************
*** 114,131 ****
  
  # Various commands:
  SHELL  = /bin/sh
! FASTCP = /usr/lib/fastcp
! CHANGES = /usr/lib/changes
! ARCH_TOOL = /usr/lib/arch_tool
! ARCHIFY = /usr/lib/arch_tool -archify_list
  CHOWN  = /etc/chown
  CHMOD  = /bin/chmod
! TAR    = /usr/bin/gnutar
  STRIP  = /bin/strip
  RM     = /bin/rm
  LN     = /bin/ln
  ECHO   = /bin/echo
! MKDIRS = /bin/mkdirs
  TOUCH  = /usr/bin/touch
  AWK    = /bin/awk
  PSWRAP = /usr/bin/pswrap
--- 115,135 ----
  
  # Various commands:
  SHELL  = /bin/sh
! FASTCP = /bin/cp
! CP = /bin/cp
! CHANGES =
! ARCH_TOOL =
! ARCHIFY =
  CHOWN  = /etc/chown
  CHMOD  = /bin/chmod
! TAR    = /usr/bin/tar
  STRIP  = /bin/strip
+ MV     = mv
  RM     = /bin/rm
  LN     = /bin/ln
  ECHO   = /bin/echo
! MAKEDEPEND	= $(MAKEFILEDIR)/makedepend
! MKDIRS = /bin/mkdir
  TOUCH  = /usr/bin/touch
  AWK    = /bin/awk
  PSWRAP = /usr/bin/pswrap
***************
*** 148,167 ****
  
  ### Use a set of basic suffix-style rules:
  
! COMMON_APP_MAKEFILE_DIR = /NextDeveloper/Makefiles/app
  include $(COMMON_APP_MAKEFILE_DIR)/basicrules.make
  
  ### Some utility definitions used throughout the PB Makefiles
  
  process_target_archs = \
! 	if [ -n "$(TARGET_ARCHS)" ] ; then \
! 		archs="$(TARGET_ARCHS)" ; \
! 		arch_cflags=`$(ARCHIFY) $$archs`; \
! 	else \
! 		archs="$(RC_ARCHS)" ; \
! 		arch_cflags="$(RC_CFLAGS)" ; \
! 	fi ; \
! 	obj_dir=`$(ARCH_TOOL) -choose_obj_dir $$archs`
  
  set_bundle_ext = \
  	if [ -z "$(BUNDLE_EXTENSION)" ] ; then \
--- 152,166 ----
  
  ### Use a set of basic suffix-style rules:
  
! COMMON_APP_MAKEFILE_DIR = $(MAKEFILEDIR)
  include $(COMMON_APP_MAKEFILE_DIR)/basicrules.make
  
  ### Some utility definitions used throughout the PB Makefiles
  
  process_target_archs = \
! 	archs="$(RC_ARCHS)" ; \
! 	arch_cflags="$(RC_CFLAGS)" ; \
! 	obj_dir="$(RC_ARCHS)
  
  set_bundle_ext = \
  	if [ -z "$(BUNDLE_EXTENSION)" ] ; then \
***************
*** 193,205 ****
        sym_dir=$$abs_sym_dir 
  
  subprojs $(SUBPROJ_OFILES):
! 	@(targets=`$(CHANGES_COMMAND) $(SUBPROJECTS)`;\
! 	for ofile in $(SUBPROJ_OFILES) none ; do \
  	   if [ $$ofile = "none" ] ; then break; fi ; \
  	   if [ ! -f $(OFILE_DIR)/$$ofile ] ; then \
  	      targets="$(SUBPROJECTS)" ; break; \
  	   fi ; \
  	done ; \
  	$(use_default_directory_args) ;\
  	for sub in $$targets none ; do \
  	   if [ $$sub = "none" ] ; then break; fi ;\
--- 192,204 ----
        sym_dir=$$abs_sym_dir 
  
  subprojs $(SUBPROJ_OFILES):
! 	@(for ofile in $(SUBPROJ_OFILES) none ; do \
  	   if [ $$ofile = "none" ] ; then break; fi ; \
  	   if [ ! -f $(OFILE_DIR)/$$ofile ] ; then \
  	      targets="$(SUBPROJECTS)" ; break; \
  	   fi ; \
  	done ; \
+ 	targets="$(SUBPROJECTS)" ; \
  	$(use_default_directory_args) ;\
  	for sub in $$targets none ; do \
  	   if [ $$sub = "none" ] ; then break; fi ;\
***************
*** 207,213 ****
  		$(use_absolute_directory_args) ; \
  	   fi ; \
  	   $(PUSHD) $$sub; $(ECHO) Making $$sub ; \
! 	   $(MAKE) project "NAME = $$sub" \
  	   		   "PRODUCT_ROOT = $$prod_root" \
  		 	   "TOP_PRODUCT_ROOT = $(TOP_PRODUCT_ROOT)" \
  			   "OFILE_DIR = $$ofile_dir/$$sub" \
--- 206,212 ----
  		$(use_absolute_directory_args) ; \
  	   fi ; \
  	   $(PUSHD) $$sub; $(ECHO) Making $$sub ; \
! 	   $(MAKE) project -f MakefileX "NAME = $$sub" \
  	   		   "PRODUCT_ROOT = $$prod_root" \
  		 	   "TOP_PRODUCT_ROOT = $(TOP_PRODUCT_ROOT)" \
  			   "OFILE_DIR = $$ofile_dir/$$sub" \
***************
*** 223,230 ****
  	done )
  
  bundles:
! 	@(targets=`$(CHANGES_COMMAND) $(BUNDLES)` ; \
! 	$(use_default_directory_args) ;\
  	for bun in $$targets none ; do \
  	   if [ $$bun = "none" ] ; then break; fi ; \
  	   if [ -h $$bun ] ; then \
--- 222,228 ----
  	done )
  
  bundles:
! 	@($(use_default_directory_args) ;\
  	for bun in $$targets none ; do \
  	   if [ $$bun = "none" ] ; then break; fi ; \
  	   if [ -h $$bun ] ; then \
***************
*** 231,237 ****
  	      $(use_absolute_directory_args) ; \
  	   fi ; \
  	   $(PUSHD) $$bun; $(ECHO) Making $$bun ; \
! 	   $(MAKE) project "NAME = $$bun" \
  		 	   "TOP_PRODUCT_ROOT = $(TOP_PRODUCT_ROOT)" \
  	                   "BUNDLE_DIR = $$prod_root/$$bun" \
  	                   "BUNDLE_PARENT_PRODUCT_DIR = $$prod_root" \
--- 229,235 ----
  	      $(use_absolute_directory_args) ; \
  	   fi ; \
  	   $(PUSHD) $$bun; $(ECHO) Making $$bun ; \
! 	   $(MAKE) project -f MakefileX "NAME = $$bun" \
  		 	   "TOP_PRODUCT_ROOT = $(TOP_PRODUCT_ROOT)" \
  	                   "BUNDLE_DIR = $$prod_root/$$bun" \
  	                   "BUNDLE_PARENT_PRODUCT_DIR = $$prod_root" \
***************
*** 248,255 ****
  	done )
  
  tools:
! 	@(targets=`$(CHANGES_COMMAND) $(TOOLS)` ; \
! 	$(use_default_directory_args) ;\
  	for tool in $$targets none ; do \
  	   if [ $$tool = "none" ] ; then break; fi ; \
  	   if [ -h $$tool ] ; then \
--- 246,252 ----
  	done )
  
  tools:
! 	@($(use_default_directory_args) ;\
  	for tool in $$targets none ; do \
  	   if [ $$tool = "none" ] ; then break; fi ; \
  	   if [ -h $$tool ] ; then \
***************
*** 256,262 ****
  	      $(use_absolute_directory_args) ; \
  	   fi ; \
  	   $(PUSHD) $$tool; $(ECHO) Making $$tool ; \
! 	   $(MAKE) project "NAME = $$tool" \
  		 	   "TOP_PRODUCT_ROOT = $(TOP_PRODUCT_ROOT)" \
  	                   "PRODUCT_ROOT = $$prod_root" \
  			   "OFILE_DIR = $$ofile_dir/$$tool" \
--- 253,259 ----
  	      $(use_absolute_directory_args) ; \
  	   fi ; \
  	   $(PUSHD) $$tool; $(ECHO) Making $$tool ; \
! 	   $(MAKE) project -f MakefileX "NAME = $$tool" \
  		 	   "TOP_PRODUCT_ROOT = $(TOP_PRODUCT_ROOT)" \
  	                   "PRODUCT_ROOT = $$prod_root" \
  			   "OFILE_DIR = $$ofile_dir/$$tool" \
***************
*** 272,278 ****
  
  .bproj.strip .tproj.strip:
  	@(cd $<; \
! 	$(MAKE) strip "DSTROOT = $(DSTROOT)" \
  		      "PARENT_DIR = $(PARENT_DIR)" \
  		      "NAME=$*")
  		
--- 269,275 ----
  
  .bproj.strip .tproj.strip:
  	@(cd $<; \
! 	$(MAKE) strip -f MakefileX "DSTROOT = $(DSTROOT)" \
  		      "PARENT_DIR = $(PARENT_DIR)" \
  		      "NAME=$*")
  		
***************
*** 283,291 ****
  
  # The following rule insures that resources for this particular level in the project hierarchy get copied over to the appropriate place in the PRODUCT_ROOT.  Note that we depend on VPATH including $(LANGUAGE).lproj so that the LOCAL_RESOURCES are found correctly.  FASTCP is used to minimize the copying of files, since most resources are likely to be up to date most of the time.
  
! resources:: $(LOCAL_RESOURCES) $(GLOBAL_RESOURCES) $(HELP_STORES) $(OTHER_RESOURCES)
  	@(if [ "$(PRODUCT_ROOT)" != "." ] ; then \
! 		$(MKDIRS) $(PRODUCT_ROOT)/$(LANGUAGE).lproj ; \
  	fi ; \
  	if [ "$(LOCAL_RESOURCES)" != "" ] ; then \
  	   locals="" ; \
--- 280,291 ----
  
  # The following rule insures that resources for this particular level in the project hierarchy get copied over to the appropriate place in the PRODUCT_ROOT.  Note that we depend on VPATH including $(LANGUAGE).lproj so that the LOCAL_RESOURCES are found correctly.  FASTCP is used to minimize the copying of files, since most resources are likely to be up to date most of the time.
  
! #in line below, $(HELP_STORES) was taken out
! resources:: $(LOCAL_RESOURCES) $(GLOBAL_RESOURCES) $(OTHER_RESOURCES)
  	@(if [ "$(PRODUCT_ROOT)" != "." ] ; then \
! 		if [ ! -d  $(PRODUCT_ROOT)/$(LANGUAGE).lproj ] ; then \
! 			$(MKDIRS) $(PRODUCT_ROOT)/$(LANGUAGE).lproj ; \
! 		fi ; \
  	fi ; \
  	if [ "$(LOCAL_RESOURCES)" != "" ] ; then \
  	   locals="" ; \
***************
*** 310,325 ****
  # rules for copying, cleaning and making dependencies
  
  .bproj.copy .subproj.copy .tproj.copy:
! 	@(cd $<; $(MAKE) copy "NAME=$*" "DEST=$(DEST)/$<")
  
  .bproj.clean .subproj.clean .tproj.clean:
  	@(echo Cleaning $<... ; cd $<; \
! 	  $(MAKE) clean "NAME=$*")
  
  .bproj.depend .subproj.depend .tproj.depend:
  	@(sym_dir=`echo $(SYM_DIR) | sed '/^[^/]/s:^:../:'` ; \
  	cd $<; \
! 	$(MAKE) depend "NAME=$*" \
                         "PROJ_CFLAGS = $(CFLAGS) $(PROJ_CFLAGS) $(OTHER_CFLAGS) -I$$sym_dir/$<" )
  
  SRCROOT DEST:
--- 310,325 ----
  # rules for copying, cleaning and making dependencies
  
  .bproj.copy .subproj.copy .tproj.copy:
! 	@(cd $<; $(MAKE) copy -f MakefileX "NAME=$*" "DEST=$(DEST)/$<")
  
  .bproj.clean .subproj.clean .tproj.clean:
  	@(echo Cleaning $<... ; cd $<; \
! 	  $(MAKE) clean -f MakefileX "NAME=$*")
  
  .bproj.depend .subproj.depend .tproj.depend:
  	@(sym_dir=`echo $(SYM_DIR) | sed '/^[^/]/s:^:../:'` ; \
  	cd $<; \
! 	$(MAKE) depend -f MakefileX "NAME=$*" \
                         "PROJ_CFLAGS = $(CFLAGS) $(PROJ_CFLAGS) $(OTHER_CFLAGS) -I$$sym_dir/$<" )
  
  SRCROOT DEST:
***************
*** 328,334 ****
  
  $(DEST)::
  	-$(RM) -rf $(DEST)
! 	@$(MKDIRS) $(DEST)
  
  $(NAME).copy:: DEST $(DEST) $(SRCFILES)
  	@(if [ "$(SRCFILES)" != "" ] ; then \
--- 328,336 ----
  
  $(DEST)::
  	-$(RM) -rf $(DEST)
! 	@(if [ ! -d  $(DEST) ] ; then \
! 		$(MKDIRS) $(DEST) ; \
! 	fi)
  
  $(NAME).copy:: DEST $(DEST) $(SRCFILES)
  	@(if [ "$(SRCFILES)" != "" ] ; then \
***************
*** 335,341 ****
  	       $(ECHO) "$(TAR) chf - $(SRCFILES) | (cd $(DEST); $(TAR) xf -)" ; \
  	       $(TAR) chf - $(SRCFILES) | (cd $(DEST); $(TAR) xf -) ; \
  	fi ; \
! 	$(MKDIRS) $(DEST)/$(LANGUAGE).lproj ; \
  	if [ "$(LOCAL_RESOURCES)" != "" ] ; then \
  	   $(ECHO) "(cd $(LANGUAGE).lproj; $(TAR) chf - $(LOCAL_RESOURCES)) | (cd $(DEST)/$(LANGUAGE).lproj; $(TAR) xf - )" ; \
  	   (cd $(LANGUAGE).lproj; $(TAR) chf - $(LOCAL_RESOURCES)) | (cd $(DEST)/$(LANGUAGE).lproj; $(TAR) xf -) ; \
--- 337,345 ----
  	       $(ECHO) "$(TAR) chf - $(SRCFILES) | (cd $(DEST); $(TAR) xf -)" ; \
  	       $(TAR) chf - $(SRCFILES) | (cd $(DEST); $(TAR) xf -) ; \
  	fi ; \
! 	if [ ! -d  $(DEST)/$(LANGUAGE).lproj ] ; then \
! 		$(MKDIRS) $(DEST)/$(LANGUAGE).lproj ; \
! 	fi ; \
  	if [ "$(LOCAL_RESOURCES)" != "" ] ; then \
  	   $(ECHO) "(cd $(LANGUAGE).lproj; $(TAR) chf - $(LOCAL_RESOURCES)) | (cd $(DEST)/$(LANGUAGE).lproj; $(TAR) xf - )" ; \
  	   (cd $(LANGUAGE).lproj; $(TAR) chf - $(LOCAL_RESOURCES)) | (cd $(DEST)/$(LANGUAGE).lproj; $(TAR) xf -) ; \
***************
*** 354,374 ****
  $(NAME).clean::
  	@if [ ! -w . ] ; then $(ECHO) '***' project write-protected; exit 1 ; fi
  	$(RM) -rf $(GARBAGE)
- 
- 
- # Build a set of dependencies for current level into Makefile.dependencies 
-    
- Makefile.dependencies:: $(CLASSES) $(MFILES) $(CFILES) $(CCFILES) $(CAPCFILES) $(CXXFILES) $(CPPFILES) $(INITIAL_TARGETS)
- 	$(RM) -f Makefile.dependencies 
- 	@if [ "$(ENGLISH)" = "YES" -o "$(JAPANESE)" != "YES" ] ; then \
- 		language_cflags="" ; \
- 	else \
- 		language_cflags="-DKANJI" ; \
- 	fi ; \
- 	echo "$(CC) -MM $(ALL_CFLAGS) $$language_cflags $(CLASSES) $(MFILES) $(CFILES) $(CCFILES) $(CAPCFILES) $(CXXFILES) $(CPPFILES) > Makefile.dependencies" ; \
- 	$(CC) -MM $(ALL_CFLAGS) $$language_cflags $(CLASSES) $(MFILES) $(CFILES) \
- 	            $(CCFILES) $(CAPCFILES) $(CXXFILES) $(CPPFILES) \
- 	   >  Makefile.dependencies
  		
  
  copy:: $(NAME).copy $(BUNDLES:.bproj=.copy) \
--- 358,363 ----
***************
*** 382,388 ****
  	@chmod -R a-w *
  
  installsrc:: SRCROOT
! 	@($(MAKE) copy "DEST=$(SRCROOT)")
  
  installhdrs::
  
--- 371,377 ----
  	@chmod -R a-w *
  
  installsrc:: SRCROOT
! 	@($(MAKE) copy -f MakefileX "DEST=$(SRCROOT)")
  
  installhdrs::
  
***************
*** 392,403 ****
  	else \
  	   bundle_ext=$(BUNDLE_EXTENSION) ; \
  	fi ; \
! 	$(MAKE) actual_clean "BUNDLE_EXTENSION = $$bundle_ext")
  	
  actual_clean:: $(NAME).clean $(BUNDLES:.bproj=.clean) \
  			     $(SUBPROJECTS:.subproj=.clean) \
  			     $(TOOLS:.tproj=.clean)
  
  
! 
  
--- 381,405 ----
  	else \
  	   bundle_ext=$(BUNDLE_EXTENSION) ; \
  	fi ; \
! 	$(MAKE) actual_clean -f MakefileX "BUNDLE_EXTENSION = $$bundle_ext")
  	
  actual_clean:: $(NAME).clean $(BUNDLES:.bproj=.clean) \
  			     $(SUBPROJECTS:.subproj=.clean) \
  			     $(TOOLS:.tproj=.clean)
  
+ move_ofiles::
+ 	@(for myofile in $(OFILE_DIR)/*.o ; do \
+ 		if [ -f $$myofile ] ; then \
+ 			$(MV) $(OFILE_DIR)/*.o ./ ; \
+ 			break ; \
+ 		fi ; \
+ 	done)
  
! move_ofiles_back::
! 	@(for myofile in *.o ; do \
! 		if [ -f $$myofile ] ; then \
! 			$(MV) ./*.o $(OFILE_DIR) ; \
! 			break ; \
! 		fi ; \
! 	done)
  
