]> git.saurik.com Git - apple/system_cmds.git/blob - zic.tproj/Makefile.postamble
system_cmds-431.tar.gz
[apple/system_cmds.git] / zic.tproj / Makefile.postamble
1 ###############################################################################
2 # NeXT Makefile.postamble
3 # Copyright 1996, NeXT Software, Inc.
4 #
5 # This Makefile is used for configuring the standard app makefiles associated
6 # with ProjectBuilder.
7 #
8 # Use this template to set attributes for a project, sub-project, bundle, or
9 # palette. Each node in the project's tree of sub-projects and bundles
10 # should have it's own Makefile.preamble and Makefile.postamble. Additional
11 # rules (e.g., after_install) that are defined by the developer should be
12 # defined in this file.
13 #
14 ###############################################################################
15 #
16 # Here are the variables exported by the common "app" makefiles that can be
17 # used in any customizations you make to the template below:
18 #
19 # PRODUCT_ROOT - Name of the directory to which resources are copied.
20 # OFILE_DIR - Directory into which .o object files are generated.
21 # (Note that this name is calculated based on the target
22 # architectures specified in Project Builder).
23 # DERIVED_SRC_DIR - Directory used for all other derived files
24 # ALL_CFLAGS - All the flags passed to the cc(1) driver for compilations
25 #
26 # NAME - name of application, bundle, subproject, palette, etc.
27 # LANGUAGE - langage in which the project is written (default "English")
28 # LOCAL_RESOURCES - localized resources (e.g. nib's, images) of project
29 # GLOBAL_RESOURCES - non-localized resources of project
30 # PROJECTVERSION - version of ProjectBuilder project (NS3.X = 1.1, NS4.0 = 2.0)
31 # ICONSECTIONS - Specifies icon sections when linking executable
32 #
33 # CLASSES - Class implementation files in project.
34 # HFILES - Header files in project.
35 # MFILES - Other Objective-C source files in project.
36 # CFILES - Other C source files in project.
37 # PSWFILES - .psw files in the project
38 # PSWMFILES - .pswm files in the project
39 # SUBPROJECTS - Subprojects of this project
40 # BUNDLES - Bundle subprojects of this project
41 # OTHERSRCS - Other miscellaneous sources of this project
42 # OTHERLINKED - Source files not matching a standard source extention
43 #
44 # LIBS - Libraries to link with when making app target
45 # DEBUG_LIBS - Libraries to link with when making debug target
46 # PROF_LIBS - Libraries to link with when making profile target
47 # OTHERLINKEDOFILES - Other relocatable files to (always) link in.
48 #
49 # APP_MAKEFILE_DIR - Directory in which to find generic set of Makefiles
50 # MAKEFILEDIR - Directory in which to find $(MAKEFILE)
51 # MAKEFILE - Top level mechanism Makefile (e.g., app.make, bundle.make)
52 # INSTALLDIR - Directory app will be installed into by 'install' target
53 #
54 ###############################################################################
55
56
57 # Change defaults assumed by the standard makefiles here. Edit the
58 # following default values as appropriate. (Note that if no Makefile.postamble
59 # exists, these values will have defaults set in common.make).
60
61 # Versioning of frameworks, libraries, bundles, and palettes:
62 #CURRENTLY_ACTIVE_VERSION = YES
63 # Set to "NO" to produce a compatibility binary
64 #DEPLOY_WITH_VERSION_NAME = A
65 # This should be incremented as your API changes.
66 #COMPATIBILITY_PROJECT_VERSION = 1
67 # This should be incremented as your API grows.
68 #CURRENT_PROJECT_VERSION = 1
69 # Defaults to using the "vers_string" hack.
70
71 # Some compiler flags can be easily overridden here, but onlytake effect at
72 # the top-level:
73 #OPTIMIZATION_CFLAG = -O
74 #DEBUG_SYMBOLS_CFLAG = -g
75 #WARNING_CFLAGS = -Wmost
76 #DEBUG_BUILD_CFLAGS = -DDEBUG
77 #PROFILE_BUILD_CFLAGS = -pg -DPROFILE
78
79 # This definition will suppress stripping of debug symbols when an executable
80 # is installed. By default it is YES.
81 # STRIP_ON_INSTALL = NO
82
83 # Flags passed to yacc
84 #YFLAGS = -d
85
86 # Library and Framework projects only:
87 # 1. If you want something other than the default .dylib name, override it here
88 #DYLIB_INSTALL_NAME = lib$(NAME).dylib
89
90 # 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.
91 #DYLIB_INSTALL_DIR = $(INSTALLDIR)
92
93 # Ownership and permissions of files installed by 'install' target
94 #INSTALL_AS_USER = root
95 # User/group ownership
96 #INSTALL_AS_GROUP = wheel
97 # (probably want to set both of these)
98 #INSTALL_PERMISSIONS =
99 # If set, 'install' chmod's executable to this
100
101 # Options to strip for various project types. Note: -S strips debugging symbols
102 # (executables can be stripped down further with -x or, if they load no bundles, with no
103 # options at all).
104 #APP_STRIP_OPTS = -S
105 #TOOL_STRIP_OPTS = -S
106 #LIBRARY_STRIP_OPTS = -S
107 # for .a archives
108 #DYNAMIC_STRIP_OPTS = -S
109 # for bundles and shared libraries
110
111 #########################################################################
112 # Put rules to extend the behavior of the standard Makefiles here. "Official"
113 # user-defined rules are:
114 # * before_install
115 # * after_install
116 # * after_installhdrs
117 # You should avoid redefining things like "install" or "app", as they are
118 # owned by the top-level Makefile API and no context has been set up for where
119 # derived files should go.
120 #
121 # Note: on MS Windows, executables, have an extension, so rules and dependencies
122 # for generated tools should use $(EXECUTABLE_EXT) on the end.
123
124 ###############################################################################
125 # Install /usr/share/zoneinfo files
126 ###############################################################################
127
128 VPATH += :datfiles
129
130 # If you always want time values interpreted as "seconds since the epoch
131 # (not counting leap seconds)", use
132 # REDO= posix_only
133 # below. If you always want right time values interpreted as "seconds since
134 # the epoch" (counting leap seconds)", use
135 # REDO= right_only
136 # below. If you want both sets of data available, with leap seconds not
137 # counted normally, use
138 # REDO= posix_right
139 # below. If you want both sets of data available, with leap seconds counted
140 # normally, use
141 # REDO= right_posix
142 # below.
143
144 REDO= posix_only
145
146 TZDIR= ${DSTROOT}/usr/share/zoneinfo
147 LOCALTIME= US/Pacific
148 POSIXRULES= US/Pacific
149
150 YEARISTYPE= datfiles/yearistype.sh
151 YEARISTYPECOPY= ${SYM_DIR}/yearistypecopy
152
153 # pacificnew is obsolete and was removed from YDATA
154 YDATA= africa antarctica asia australasia \
155 europe northamerica southamerica etcetera factory \
156 backward
157 NDATA= systemv
158 SDATA= solar87 solar88 solar89
159 TDATA= $(YDATA) $(NDATA) $(SDATA)
160 DATA= $(YDATA) $(NDATA) $(SDATA) leapseconds # yearistype.sh
161 USNO= usno1988 usno1989
162
163 Embedded=$(shell tconf --test TARGET_OS_EMBEDDED)
164
165 # Embedded zic is probably not built with the same architecture as
166 # the build host, so we can't use the recently built copy.
167 ifeq "$(Embedded)" "YES"
168 ZIC=/usr/sbin/zic
169 else
170 ZIC=${DSTROOT}/usr/sbin/zic
171 endif
172
173 ${YEARISTYPECOPY}:
174 cp ${YEARISTYPE} ${YEARISTYPECOPY}
175 chmod u+x ${YEARISTYPECOPY}
176
177 posix_only: ${TDATA} ${YEARISTYPECOPY}
178 (cd datfiles; \
179 ${ZIC} -y ${YEARISTYPECOPY} -d ${TZDIR} -L /dev/null ${TDATA})
180
181 right_only: leapseconds ${TDATA} ${YEARISTYPECOPY}
182 (cd datfiles; \
183 ${ZIC} -y ${YEARISTYPECOPY} -d ${TZDIR} -L leapseconds ${TDATA})
184
185 other_two: leapseconds ${TDATA} ${YEARISTYPECOPY}
186 (cd datfiles; \
187 ${ZIC} -y ${YEARISTYPECOPY} -d ${TZDIR}/posix -L /dev/null ${TDATA})
188 (cd datfiles; \
189 ${ZIC} -y ${YEARISTYPECOPY} -d ${TZDIR}/right -L leapseconds ${TDATA})
190
191 posix_right: posix_only other_two
192
193 right_posix: right_only other_two
194
195 #after_install:: ${DATA} ${REDO} ${YEARISTYPECOPY}
196 # ${ZIC} -y ${YEARISTYPECOPY} -d ${TZDIR} -p ${POSIXRULES}
197 # chown -R ${BINOWN}:${BINGRP} ${TZDIR}
198 # find ${TZDIR} -type f | xargs chmod a=r
199 # -rm -f ${DSTROOT}/etc/localtime
200 # ln -s ${TZDIR}/${LOCALTIME} ${DSTROOT}/etc/localtime
201
202 #since we are not doing native builds ... hack hack hack
203
204 # pacificnew is obsolete and was removed from ZONE_FILES
205 ZONE_FILES = africa antarctica asia australasia europe northamerica southamerica etcetera factory backward systemv solar87 solar88 solar89
206 ZONEINFO = ${DSTROOT}/usr/share/zoneinfo
207
208 # ftp://elsie.nci.nih.gov/pub/tzdata*.tar.gz
209 # the tzdata*.tar.gz file is automatically unpacked and a version file created
210 # /usr/local/share/tz/tzdata*.tar.gz is installed by the TimeZoneData project
211 DATFILES = ${OFILE_DIR}/datfiles
212 TARBALL = $(shell echo /usr/local/share/tz/tzdata*)
213 DATVERS = $(shell basename ${TARBALL} | sed -e 's,\..*,,' -e 's/^tzdata//')
214 VERSIONFILE = ${ZONEINFO}/+VERSION
215
216 ${DATFILES}:
217 mkdir -p ${DATFILES}
218 cd ${DATFILES} && tar xzf ${TARBALL}
219
220 after_install:: ${DATFILES}
221 -mkdir -p ${DSTROOT}/usr/share
222 -rm -rf ${ZONEINFO}
223 mkdir -p ${ZONEINFO}
224 for tz in ${ZONE_FILES}; do \
225 if [[ $${tz} = "northamerica" ]]; then \
226 ${ZIC} -p America/New_York -L /dev/null -d ${ZONEINFO} -y ${DATFILES}/yearistype.sh ${DATFILES}/$${tz}; \
227 else \
228 ${ZIC} -L /dev/null -d ${ZONEINFO} -y ${DATFILES}/yearistype.sh ${DATFILES}/$${tz}; \
229 fi \
230 done
231 chmod -R og-w ${ZONEINFO}
232 install -c -m 444 ${DATFILES}/zone.tab ${ZONEINFO}
233 install -c -m 444 ${DATFILES}/iso3166.tab ${ZONEINFO}
234 ifeq "$(Embedded)" "YES"
235 -mkdir -p ${DSTROOT}/private/var/db
236 -rm -f ${DSTROOT}/private/var/db/localtime
237 ln -fs /usr/share/zoneinfo/${LOCALTIME} ${DSTROOT}/private/var/db/localtime
238 else
239 -mkdir -p ${DSTROOT}/private/etc
240 -rm -f ${DSTROOT}/private/etc/localtime
241 ln -fs /usr/share/zoneinfo/${LOCALTIME} ${DSTROOT}/private/etc/localtime
242 endif
243 mkdir -p ${DSTROOT}/usr/share/man/man8
244 install -c -m 444 zic.8 ${DSTROOT}/usr/share/man/man8
245 echo ${DATVERS} > ${VERSIONFILE}
246 chmod 444 ${VERSIONFILE}