Makefile.postamble   [plain text]


###############################################################################
#  NeXT Makefile.postamble
#  Copyright 1996, NeXT Software, Inc.
#
#  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 the directory to which resources are copied.
#	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")
#	LOCAL_RESOURCES - localized resources (e.g. nib's, images) of project
#	GLOBAL_RESOURCES - non-localized resources of project
#	PROJECTVERSION - version of ProjectBuilder project (NS3.X = 1.1, NS4.0 = 2.0)
#	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).

# Versioning of frameworks, libraries, bundles, and palettes:
#CURRENTLY_ACTIVE_VERSION = YES
       # Set to "NO" to produce a compatibility binary
#DEPLOY_WITH_VERSION_NAME = A
       # This should be incremented as your API changes.
#COMPATIBILITY_PROJECT_VERSION = 1
       # This should be incremented as your API grows.
#CURRENT_PROJECT_VERSION = 1       
       # Defaults to using the "vers_string" hack.

# Some compiler flags can be easily overridden here, but onlytake effect at 
# the top-level:
#OPTIMIZATION_CFLAG = -O
#DEBUG_SYMBOLS_CFLAG = -g
#WARNING_CFLAGS = -Wmost
#DEBUG_BUILD_CFLAGS = -DDEBUG
#PROFILE_BUILD_CFLAGS = -pg -DPROFILE

# This definition will suppress stripping of debug symbols when an executable
# is installed.  By default it is YES.
# STRIP_ON_INSTALL = NO

# 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/group ownership 
#INSTALL_AS_GROUP = wheel
        # (probably want to set both of these) 
#INSTALL_PERMISSIONS =
        # If set, 'install' chmod's executable to this

# Options to strip for various project types. Note: -S strips debugging symbols
#    (executables can be stripped down further with -x or, if they load no bundles, with no
#     options at all).
#APP_STRIP_OPTS = -S
#TOOL_STRIP_OPTS = -S
#LIBRARY_STRIP_OPTS = -S
        # for .a archives
#DYNAMIC_STRIP_OPTS = -S
        # for bundles and shared libraries

#########################################################################
# 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.
#
# Note: on MS Windows, executables, have an extension, so rules and dependencies
#       for generated tools should use $(EXECUTABLE_EXT) on the end.

###############################################################################
# Install /usr/share/zoneinfo files
###############################################################################

VPATH += :datfiles

# If you always want time values interpreted as "seconds since the epoch
# (not counting leap seconds)", use
# 	REDO=		posix_only
# below.  If you always want right time values interpreted as "seconds since
# the epoch" (counting leap seconds)", use
#	REDO=		right_only
# below.  If you want both sets of data available, with leap seconds not
# counted normally, use
#	REDO=		posix_right
# below.  If you want both sets of data available, with leap seconds counted
# normally, use
#	REDO=		right_posix
# below.

REDO=		posix_only

TZDIR=		${DSTROOT}/usr/share/zoneinfo
LOCALTIME=	US/Pacific
POSIXRULES=	US/Pacific

YEARISTYPE=	datfiles/yearistype.sh
YEARISTYPECOPY=	${SYM_DIR}/yearistypecopy

YDATA=		africa antarctica asia australasia \
		europe northamerica southamerica pacificnew etcetera factory \
		backward
NDATA=		systemv
SDATA=		solar87 solar88 solar89
TDATA=		$(YDATA) $(NDATA) $(SDATA)
DATA=		$(YDATA) $(NDATA) $(SDATA) leapseconds # yearistype.sh
USNO=		usno1988 usno1989

ZIC=zic

${YEARISTYPECOPY}:
	cp ${YEARISTYPE} ${YEARISTYPECOPY}
	chmod u+x ${YEARISTYPECOPY}

posix_only: ${TDATA} ${YEARISTYPECOPY}
	(cd datfiles; \
	    ${ZIC} -y ${YEARISTYPECOPY} -d ${TZDIR} -L /dev/null ${TDATA})

right_only: leapseconds ${TDATA} ${YEARISTYPECOPY}
	(cd datfiles; \
	    ${ZIC} -y ${YEARISTYPECOPY} -d ${TZDIR} -L leapseconds ${TDATA})

other_two: leapseconds ${TDATA} ${YEARISTYPECOPY}
	(cd datfiles; \
	    ${ZIC} -y ${YEARISTYPECOPY} -d ${TZDIR}/posix -L /dev/null ${TDATA})
	(cd datfiles; \
	    ${ZIC} -y ${YEARISTYPECOPY} -d ${TZDIR}/right -L leapseconds ${TDATA})

posix_right: posix_only other_two

right_posix: right_only other_two

#after_install:: ${DATA} ${REDO} ${YEARISTYPECOPY}
#	${ZIC} -y ${YEARISTYPECOPY} -d ${TZDIR} -p ${POSIXRULES}
#	chown -R ${BINOWN}:${BINGRP} ${TZDIR}
#	find ${TZDIR} -type f | xargs chmod a=r
#	-rm -f ${DSTROOT}/etc/localtime
#	ln -s ${TZDIR}/${LOCALTIME} ${DSTROOT}/etc/localtime

#since we are not doing native builds ... hack hack hack

ZONE_FILES = africa antarctica asia australasia europe northamerica southamerica pacificnew etcetera factory backward systemv solar87 solar88 solar89

after_install::
	-mkdir -p ${DSTROOT}/usr/share
	-rm -rf ${DSTROOT}/usr/share/zoneinfo
	mkdir -p ${DSTROOT}/usr/share/zoneinfo
	for tz in $(ZONE_FILES); do \
		zic -L /dev/null -d ${DSTROOT}/usr/share/zoneinfo -y datfiles/yearistype.sh datfiles/$${tz}; \
	done
	chmod -R og-w ${DSTROOT}/usr/share/zoneinfo
	-mkdir -p ${DSTROOT}/private/etc
	-rm -f ${DSTROOT}/private/etc/localtime
	ln -fs /usr/share/zoneinfo/${LOCALTIME} ${DSTROOT}/private/etc/localtime