home *** CD-ROM | disk | FTP | other *** search
Wrap
# # app.make # # Inputs from Makefile.preamble (no defaults): # OTHER_CFLAGS - Flags passed to compiler (in addition to -g, -O, etc.) # OTHER_LDFLAGS - Flags passed to ld (in addition to -ObjC, etc.) # OTHER_OFILES - Additional relocatables that may be linked in # OTHER_LIBS - Libraries to link with when making app target # OTHER_DEBUG_LIBS - Libraries to link with when making debug target # OTHER_PROF_LIBS - Libraries to link with when making profile target # OTHER_JAPANESE_LIBS - 'app' libraries when $(JAPANESE) = "YES" # OTHER_JAPANESE_DEBUG_LIBS - 'debug' libraries when $(JAPANESE) = "YES" # OTHER_JAPANESE_PROF_LIBS - 'profile' libs when $(JAPANESE) = "YES" # OTHER_PRODUCT_DEPENDS - Other dependencies of this project # OTHER_SOURCEFILES - Other source files maintained by .pre/postamble # OTHER_GARBAGE - Additional files to be removed by make 'clean' # # MSGFILES - .msg files that should have msgwrap run on them # DEFSFILES - .defs files that should have mig run on them # MIGFILES - .mig files (no .defs files) that should have mig run on them # # PRECOMPS - Precompiled headers that should be built before compilation # OTHER_INITIAL_TARGETS - Targets to be built before subprojects, etc. # # DSTROOT - Virtual root directory prepended to $(INSTALLDIR) # # Inputs from Makefile.postamble (with defaults set in common.make): # OPTIMIZATION_CFLAG - Optimization flag passed to compiler (default: -O) # NORMAL_CFLAGS - Flags passed to compiler in normal compiles # DEBUG_CFLAGS - Flags passed to compiler in 'debug' compiles # PROFILE_CFLAGS - Flags passed to compiler in 'profile' compiles # INSTALL_AS_USER - User to chown app to at installation (default root) # INSTALL_AS_GROUP - Grp to chgrp app to at installation (default wheel) # INSTALL_PERMISSIONS - If set, 'install' chmod's executable to this. # MAKEFILES - Makefiles this project depends on (default = Makefile) # # RELOCATABLE_STRIP_OPTS - Opts to strip for bundles (default = -x -u) # DYLD_APP_STRIP_OPTS - Opts to strip for apps w/ bundles (def. = -A -n) # APP_STRIP_OPTS - Opts to strip for apps w/o bundles (no default, but # developers doing their own dynamic loading should set this to # $(DYLD_APP_STRIP_OPTS) # BUNDLE_EXTENSION - Extension for name of bundle dir (default = bundle) # # Inputs from Makefile (avoid setting these, ProjectBuilder controls them): # NAME - name of application # LANGUAGE - langage in which the project is written (default "English") # ENGLISH - boolean flag set iff $(LANGUAGE) = "English" # JAPANESE - boolean flag set iff $(LANGUAGE) = "Japanese" # LOCAL_RESOURCES - localized resources (e.g. nib's, images) of project # GLOBAL_RESOURCES - non-localized resources of project # PROJECTVERSION - version of ProjectBuilder that output Makefile # APPICON - application icon file # DOCICONS - dock icon files # ICONSECTIONS - Specifies icon sections when linking executable # # CLASSES - Class implementation files in project. # HFILES - Header files in project. # MFILES - Other Objective-C source files in project. # CFILES - Other C source files in project. # PSWFILES - .psw files in the project # PSWMFILES - .pswm files in the project # SUBPROJECTS - Subprojects of this project # BUNDLES - Bundle subprojects of this project # OTHERSRCS - Other miscellaneous sources of this project # OTHERLINKED - Source files not matching a standard source extention # # LIBS - Libraries to link with when making app target # DEBUG_LIBS - Libraries to link with when making debug target # PROF_LIBS - Libraries to link with when making profile target # OTHERLINKEDOFILES - Other relocatable files to (always) link in. # # APP_MAKEFILE_DIR - Directory in which to find generic set of Makefiles # MAKEFILEDIR - Directory in which to find $(MAKEFILE) # MAKEFILE - Top level mechanism Makefile (e.g., app.make, bundle.make) # INSTALLDIR - Directory app will be installed into by 'install' target # APPICONFLAGS = -sectcreate __ICON __header $(NAME).iconheader \ -segprot __ICON r r $(ICONSECTIONS) \ $(OTHER_ICONSECTIONS) ICONHEADER = $(NAME).iconheader PRODUCT_ROOT = $(SYMROOT)/$(NAME).app APP_MAKEFILE_DIR = /NextDeveloper/Makefiles/app include $(APP_MAKEFILE_DIR)/common.make all:: app app:: @($(MKDIRS) $(SYMROOT)/$(NAME).app ; \ $(process_target_archs)_obj ; \ $(set_bundle_ext) ; \ if [ "$(ENGLISH)" = "YES" -o "$(JAPANESE)" != "YES" ] ; then \ language_cflags="" ; \ libs="$(LIBS)" ; \ other_libs="$(OTHER_LIBS)" ; \ else \ language_cflags="-DKANJI" ; \ libs="$(LIBS:lNeXT_s=lNeXTJ_s)" ; \ other_libs="$(OTHER_LIBS:lNeXT_s=lNeXTJ_s)" ; \ fi ; \ $(MAKE) project \ "PRODUCT_ROOT = $(SYMROOT)/$(NAME).app" \ "TOP_PRODUCT_ROOT = $(SYMROOT)/$(NAME).app" \ "PRODUCT = $(SYMROOT)/$(NAME).app/$(NAME)" \ "OFILE_DIR = $(OBJROOT)/$$obj_dir" \ "PROJ_CFLAGS = $(NORMAL_CFLAGS) $$language_cflags" \ "LIBS = $$libs" \ "OTHER_LIBS = $$other_libs" \ "APP_MAKEFILE_DIR = $(APP_MAKEFILE_DIR)" \ "BUNDLE_EXTENSION = $$bundle_ext" \ "RC_CFLAGS = $$arch_cflags" \ "RC_ARCHS = $$archs" \ "SRCROOT = $(SRCROOT)" \ "OBJROOT = $(OBJROOT)" \ "SYMROOT = $(SYMROOT)/sym" \ "SYM_DIR = $(SYMROOT)/sym" ) debug:: @($(MKDIRS) $(NAME).debug ; \ $(process_target_archs)_debug_obj ; \ $(set_bundle_ext) ; \ if [ "$(ENGLISH)" = "YES" -o "$(JAPANESE)" != "YES" ] ; then \ language_cflags="" ; \ libs="$(DEBUG_LIBS)" ; \ other_libs="$(OTHER_DEBUG_LIBS)" ; \ other_japanese_libs="" ; \ else \ language_cflags="-DKANJI" ; \ libs="$(DEBUG_LIBS:lNeXT_s=lNeXTJ_s)" ; \ other_libs="$(OTHER_DEBUG_LIBS:lNeXT_s=lNeXTJ_s)" ; \ other_japanese_libs="$(OTHER_JAPANESE_DEBUG_LIBS)" ; \ fi ; \ $(MAKE) project \ "PRODUCT_ROOT = $(SYMROOT)/$(NAME).debug" \ "TOP_PRODUCT_ROOT = $(SYMROOT)/$(NAME).debug" \ "PRODUCT = $(SYMROOT)/$(NAME).debug/$(NAME)" \ "OFILE_DIR = $(OBJROOT)/$$obj_dir" \ "PROJ_CFLAGS = $(DEBUG_CFLAGS) $$language_cflags" \ "LIBS = $$libs" "OTHER_LIBS = $$other_libs" \ "OTHER_JAPANESE_LIBS = $$other_japanese_libs" \ "APP_MAKEFILE_DIR = $(APP_MAKEFILE_DIR)" \ "BUNDLE_EXTENSION = $$bundle_ext" \ "RC_CFLAGS = $$arch_cflags" \ "RC_ARCHS = $$archs" \ "SRCROOT = $(SRCROOT)" \ "OBJROOT = $(OBJROOT)" \ "SYMROOT = $(SYMROOT)/sym" \ "SYM_DIR = $(SYMROOT)/sym" ) profile:: @($(MKDIRS) $(NAME).profile ; \ $(process_target_archs)_profile_obj ; \ $(set_bundle_ext) ; \ if [ "$(ENGLISH)" = "YES" -o "$(JAPANESE)" != "YES" ] ; then \ language_cflags="" ; \ libs="$(PROF_LIBS)" ; \ other_libs="$(OTHER_PROF_LIBS)" ; \ other_japanese_libs="" ; \ else \ language_cflags="-DKANJI" ; \ libs="$(PROF_LIBS:lNeXT_s=lNeXTJ_s)" ; \ other_libs="$(OTHER_PROF_LIBS:lNeXT_s=lNeXTJ_s)" ; \ other_japanese_libs="$(OTHER_JAPANESE_PROF_LIBS)" ; \ fi ; \ $(MAKE) project \ "PRODUCT_ROOT = $(SYMROOT)/$(NAME).profile" \ "TOP_PRODUCT_ROOT = $(SYMROOT)/$(NAME).profile" \ "PRODUCT = $(SYMROOT)/$(NAME).profile/$(NAME)" \ "OFILE_DIR = $(OBJROOT)/$$obj_dir" \ "PROJ_CFLAGS = $(PROFILE_CFLAGS) $$language_cflags" \ "LIBS = $$libs" "OTHER_LIBS = $$other_libs" \ "OTHER_JAPANESE_LIBS = $$other_japanese_libs" \ "APP_MAKEFILE_DIR = $(APP_MAKEFILE_DIR)" \ "BUNDLE_EXTENSION = $$bundle_ext" \ "RC_CFLAGS = $$arch_cflags" \ "RC_ARCHS = $$archs" \ "SRCROOT = $(SRCROOT)" \ "OBJROOT = $(OBJROOT)" \ "SYMROOT = $(SYMROOT)/sym" \ "SYM_DIR = $(SYMROOT)/sym" ) depend:: Makefile.dependencies $(SUBPROJECTS:.subproj=.depend) $(BUNDLES:.bproj=.depend) $(TOOLS:.tproj=.depend) # Note: The order of the following project dependencies is very important. subcomponents must be after $(PROJECT_OFILES) in case a subcomponent relies upon something (e.g. generated .h file) at the top level, but all subprojects must be built (hopefully by one invocation of make in that subdirectory) before the $(PRODUCT) can be linked. project:: $(INITIAL_TARGETS) toplevel_subcomponents resources $(PRODUCT) toplevel_subcomponents:: subprojs bundles tools -@($(RM) -f $(TOP_PRODUCT_ROOT)/$(CHANGES_FILE) ; \ $(ECHO) "$(OFILE_DIR)" > $(TOP_PRODUCT_ROOT)/$(CHANGES_FILE)) $(PRODUCT): $(PRODUCT_DEPENDS) $(OTHER_PRODUCT_DEPENDS) @(adaptors="" ; \ for adaptor in $(OTHERRELOCATABLES) none ; do \ if [ $$adaptor = "none" ] ; then break; fi ; \ for path in $(ADAPTOR_SEARCH_PATH) none ; do \ if [ $$path = "none" ] ; then break; fi ;\ if [ -r $$path/$$adaptor ] ; then \ adaptors="$$adaptors $$path/$$adaptor" ; \ break ; \ fi ; \ done ; \ done ; \ if [ "$(ENGLISH)" = "YES" -o "$(JAPANESE)" != "YES" ] ; then \ other_japanese_libs=""; \ else \ other_japanese_libs="$(OTHER_JAPANESE_LIBS)" ; \ fi ; \ cmd="$(CC) $(ALL_CFLAGS) $(OBJCFLAG) $(LDFLAGS) $(OTHER_LDFLAGS) \ $(APPICONFLAGS) -o $(PRODUCT) $(OFILES) $(OTHER_OFILES) \ $$adaptors $$other_japanese_libs $(OTHER_LIBS) $(LIBS)" ; \ echo $$cmd ; \ $$cmd ) $(DSTROOT)$(INSTALLDIR): $(MKDIRS) $(DSTROOT)$(INSTALLDIR) before_install:: $(DSTROOT)$(INSTALLDIR) $(RM) -rf $(DSTROOT)$(INSTALLDIR)/$(NAME).app after_install:: install:: app before_install installhdrs $(OTHER_INSTALL_DEPENDS) (cd $(SYMROOT); $(TAR) chf - $(NAME).app) | (cd $(DSTROOT)$(INSTALLDIR); $(TAR) xf -) @somebundles=no; \ for i in $(BUNDLES:.bproj=) none ; do \ if [ $$i = none ] ; then continue; fi; \ if [ -f $(DSTROOT)$(INSTALLDIR)/$(NAME).app/$$i*/$$i ] ; then \ somebundles=yes; \ fi ; \ done; \ if [ $$somebundles = yes ] ; then \ cmd="$(STRIP) $(DYLD_APP_STRIP_OPTS) $(DSTROOT)$(INSTALLDIR)/$(NAME).app/$(NAME)"; \ else \ cmd="$(STRIP) $(APP_STRIP_OPTS) $(DSTROOT)$(INSTALLDIR)/$(NAME).app/$(NAME)"; \ fi ; \ echo $$cmd ; $$cmd ; \ $(MAKE) strip "DSTROOT = $(DSTROOT)" \ "PARENT_DIR = $(INSTALLDIR)/$(NAME).app" ; \ $(RM) -f $(DSTROOT)$(INSTALLDIR)/$(NAME).app/$(CHANGES_FILE) -$(CHOWN) -Rf $(INSTALL_AS_USER).$(INSTALL_AS_GROUP) \ $(DSTROOT)$(INSTALLDIR)/$(NAME).app -$(CHMOD) -Rf go-w $(DSTROOT)$(INSTALLDIR)/$(NAME).app @(if [ "$(INSTALL_PERMISSIONS)" != "" ] ; then \ $(ECHO) $(CHMOD) -f $(INSTALL_PERMISSIONS) \ $(DSTROOT)$(INSTALLDIR)/$(NAME).app/$(NAME); \ $(CHMOD) -f $(INSTALL_PERMISSIONS) \ $(DSTROOT)$(INSTALLDIR)/$(NAME).app/$(NAME); \ fi) @($(process_target_archs)_obj ; \ if [ "$(ENGLISH)" = "YES" -o "$(JAPANESE)" != "YES" ] ; then \ language_cflags="" ; \ else \ language_cflags="-DKANJI" ; \ fi ; \ $(MAKE) after_install "DSTROOT=$(DSTROOT)" \ "OBJROOT=$(OBJROOT)" \ "SYMROOT = $(SYMROOT)/sym" \ "SYM_DIR = $(SYMROOT)/sym" \ "INSTALLDIR = $(INSTALLDIR)" \ "PRODUCT_ROOT = $(SYMROOT)/$(NAME).app" \ "PRODUCT = $(SYMROOT)/$(NAME).app/$(NAME)" \ "OFILE_DIR = $(OBJROOT)/$$obj_dir" \ "PROJ_CFLAGS = $(NORMAL_CFLAGS) $$language_cflags" \ "APP_MAKEFILE_DIR = $(APP_MAKEFILE_DIR)" \ "RC_CFLAGS = $$arch_cflags" \ "RC_ARCHS = $$archs" ) #.DEFAULT help: @if (test "$<"); then \ $(ECHO) 'ERROR: Unrecognized Makefile target "$<"'; \ fi @$(ECHO) 'The following targets are available:' @$(ECHO) @$(ECHO) ' all Makes the app target (below). This is the default target.' @$(ECHO) @$(ECHO) ' app Compiles and links an optimized (and debuggable) version of the' @$(ECHO) ' project, ready to install, into <ProjectName>.app.' @$(ECHO) @$(ECHO) ' debug Compiles (with all warnings and -DDEBUG on) and links a ' @$(ECHO) ' fully-debuggable version of the project into a <ProjectName>.debug' @$(ECHO) ' "app wrapper".' @$(ECHO) @$(ECHO) ' profile Compiles (with all warnings and -DPROFILE on) and links a' @$(ECHO) ' version of the project into <ProjectName>.profile.' @$(ECHO) ' "app wrapper" that will, when run, generate a gprof report.' @$(ECHO) @$(ECHO) ' depend Generates an optional Makefile.dependencies file for every level' @$(ECHO) ' of the project to reflect the complete dependency graph' @$(ECHO) ' (including headers).' @$(ECHO) @$(ECHO) ' install Builds (if needed) and copies <ProjectName>.app into the' @$(ECHO) ' installation directory, setting permissions and owners as' @$(ECHO) ' appropriate.' @$(ECHO) @$(ECHO) ' installsrc Installs the source files for the project into the directory' @$(ECHO) ' specified in the SRCROOT variable in a command-line argument.' @$(ECHO) ' Note: the target directory will be removed and recreated.' @$(ECHO) @$(ECHO) ' installhdrs Installs the source files for the project.' @$(ECHO) @$(ECHO) ' clean Removes all files in the project derived from previous builds.' @$(ECHO) @$(ECHO) ' help Lists these targets with their descriptions.' @$(ECHO) @$(ECHO) 'For more details, see the comments in /NextDeveloper/Makefiles/app/*.make.'