File:  [Apple Darwin 0.x] / objc / Makefile.postamble
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 19:13:57 2018 UTC (8 years, 2 months ago) by root
Branches: MAIN, Apple
CVS tags: HEAD, Darwin03, Darwin01
Darwin 0.1 In-kernel Objective-C runtime

###############################################################################
#  NeXT Makefile.postamble Template
#  Copyright 1993, NeXT Computer, Inc.
#  Last changed: March 1995, Kresten Krab Thorup
#
#  This Makefile is used for configuring the standard app makefiles associated
#  with ProjectBuilder.  
#  
#  Use this template to set attributes for a project, sub-project, bundle, or
#  palette.  Each node in the project's tree of sub-projects and bundles 
#  should have it's own Makefile.preamble and Makefile.postamble.  Additional
#  rules (e.g., after_install) that are defined by the developer should be
#  defined in this file.
#
###############################################################################
# 
# Here are the variables exported by the common "app" makefiles that can be 
# used in any customizations you make to the template below:
# 
#	PRODUCT_ROOT - Name of top-level app-wrapper (e.g., Webster.app)
#	OFILE_DIR - Directory into which .o object files are generated.
#		    (Note that this name is calculated based on the target 
#		     architectures specified in Project Builder).
#	DERIVED_SRC_DIR - Directory used for all other derived files
#	ALL_CFLAGS - All the flags passed to the cc(1) driver for compilations
#
#	NAME - name of application, bundle, subproject, palette, etc.
#	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
#
###############################################################################


# Change defaults assumed by the standard makefiles here.  Edit the 
# following default values as appropriate. (Note that if no Makefile.postamble 
# exists, these values will have defaults set in common.make).

# Add Makefile.preamble, Makefile.postamble, and Makefile.dependencies here if
# you would like changes to them to invalidate previous builds.  The project
# depends on $(MAKEFILES) so that changes to Makefiles will trigger a re-build.
#MAKEFILES = Makefile 

# Some compiler flags can be easily overridden here:
#OPTIMIZATION_CFLAG = -O
#DEBUG_SYMBOLS_CFLAG = -g
#WARNING_CFLAGS = -Wall
#DEBUG_BUILD_CFLAGS = -DDEBUG
#PROFILE_BUILD_CFLAGS = -pg -DPROFILE

# Flags passed to yacc
#YFLAGS = -d

# Library and Framework projects only:
# 1. If you want something other than the default .dylib name, override it here
#DYLIB_INSTALL_NAME = lib$(NAME).dylib

# 2. If you want to change the -install_name flag from the absolute path to the development area, change it here.  One good choice is the installation directory.  Another one might be none at all.
#DYLIB_INSTALL_DIR = $(INSTALLDIR)


# Ownership and permissions of files installed by 'install' target
#INSTALL_AS_USER = root        # User to chown app to
#INSTALL_AS_GROUP = wheel      # Group to chgrp app to 
#INSTALL_PERMISSIONS =         # If set, 'install' chmod's executable to this

# Options to strip for bundles, apps with bundles, and apps without bundles, 
# respectively (check common.make before stting any of these yourself!)
#APP_STRIP_OPTS = -S
#TOOL_STRIP_OPTS = -S
#LIBRARY_STRIP_OPTS = -S   # Note: -S strips debugging symbols
# (Note: APP_STRIP_OPTS and TOOL_STRIP_OPTS default to empty, but
#  developers doing their own dynamic loading should set this to 
#  $(DYLD_APP_STRIP_OPTS)).

#########################################################################
# Put rules to extend the behavior of the standard Makefiles here.  "Official" 
# user-defined rules are:
#   * before_install
#   * after_install
#   * after_installhdrs
# You should avoid redefining things like "install" or "app", as they are
# owned by the top-level Makefile API and no context has been set up for where 
# derived files should go.


##
## build
##
build:
	$(MAKE) kernel							\
		"DSTROOT=/tmp/$(NAME).dst"				\
		"OBJROOT=/tmp/$(NAME).obj"				\
		"SYMROOT=/tmp/$(NAME).sym"				\
		"RC_CFLAGS = $(RC_CFLAGS)"				\
		"RC_ARCHS = $(RC_ARCHS)" 


## When the install target is invoked on this project, we need to build
## shlib, kernel, & profile statically as well.

after_install:: kernel
		$(MKDIRS) $(DSTROOT)/usr/local/lib;				\
		$(LIPO) -create -output $(DSTROOT)/usr/local/lib/libk$(NAME).o 	\
			$(SYMROOT)/*_sym/libk$(NAME).o;				\


## The kernel needs a special version of the runtime, so we move
## static_obj aside for a while and re-build it with different parameters.
## This target takes care of that, and creating a big file with 
## all the .o files in it for the kernel to link in.

kernel:
	@ \
		$(ECHO) == Building kernel target ==;					\
		$(MAKE) all "CODE_GEN_STYLE=STATIC"		   			\
			"DSTROOT=$(DSTROOT)"						\
			"OBJROOT=$(OBJROOT)"						\
			"SYMROOT=$(SYMROOT)"						\
			"RC_CFLAGS = $(KERNEL_CFLAGS) $(RC_CFLAGS)"			\
			"RC_ARCHS=$(RC_ARCHS)";						\
		$(ECHO) == Linking kernel library ==;		\
		for architecture in $(RC_ARCHS); do		  			\
			$(MKDIRS) $(SYMROOT)/$${architecture}_sym;				\
			$(ECHO) $(LD) -r -o 						\
	      		      	$(SYMROOT)/$${architecture}_sym/libk$(NAME).o        	\
	       	    		$(OBJROOT)/static_obj/$${architecture}/*.o;		\
			$(LD) -r -o 							\
	             		$(SYMROOT)/$${architecture}_sym/libk$(NAME).o        	\
	             		$(OBJROOT)/static_obj/$${architecture}/*.o;		\
		done


## The Objective C messenger is split across a number of assembly files.
## This is just dependencies to make sure it will be rebuild if changed.

objc-msg.o:: 	objc-msg-*.s


## We need this symbolic link to exist in the source directory.

installsrc::
	$(SYMLINK) $(SRCROOT) $(SRCROOT)/objc

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.