17c478bd9Sstevel@tonic-gate# 2*24fe0b3bSjmcp# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 399ba4d70SRussell Blaine# Use is subject to license terms. 47c478bd9Sstevel@tonic-gate# 57c478bd9Sstevel@tonic-gate 67c478bd9Sstevel@tonic-gateNATIVE=native 77c478bd9Sstevel@tonic-gatePROG= zic 87c478bd9Sstevel@tonic-gateKSHPROG= tzselect 97c478bd9Sstevel@tonic-gateNPROG= $(NATIVE)/$(PROG) 107c478bd9Sstevel@tonic-gate 117c478bd9Sstevel@tonic-gate# "etcetera" must be listed before "backward" because it sets up links that 127c478bd9Sstevel@tonic-gate# "backward" needs. 137c478bd9Sstevel@tonic-gateTZFILES= africa antarctica asia australasia etcetera europe \ 147c478bd9Sstevel@tonic-gate factory northamerica pacificnew solar87 solar88 solar89 \ 157c478bd9Sstevel@tonic-gate southamerica backward 167c478bd9Sstevel@tonic-gate# Don't build the systemv timezones, but do install the source file. 177c478bd9Sstevel@tonic-gateSRCFILES = $(TZFILES) systemv README 187c478bd9Sstevel@tonic-gateTABFILES = continent.tab country.tab zone_sun.tab 197c478bd9Sstevel@tonic-gate 207c478bd9Sstevel@tonic-gateOBJS= zic.o scheck.o ialloc.o 217c478bd9Sstevel@tonic-gateSRCS= $(OBJS:%.o=%.c) 227c478bd9Sstevel@tonic-gateNOBJS= $(OBJS:%=$(NATIVE)/%) 237c478bd9Sstevel@tonic-gate 243b3f3420SRussell BlaineCLOBBERFILES= $(NOBJS) $(KSHPROG) $(NPROG) $(NATIVE)/zic.c $(NATIVE)/tzfile.h 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd 277c478bd9Sstevel@tonic-gate 287c478bd9Sstevel@tonic-gateNCPPFLAGS= -I$(NATIVE) 297c478bd9Sstevel@tonic-gateROOTTZD= $(ROOTSHLIB)/zoneinfo 307c478bd9Sstevel@tonic-gateROOTTZSRCD= $(ROOTSHLIB)/zoneinfo/src 317c478bd9Sstevel@tonic-gateROOTTZTABD= $(ROOTSHLIB)/zoneinfo/tab 327c478bd9Sstevel@tonic-gateDIRS= $(ROOTTZSRCD) $(ROOTTZTABD) 337c478bd9Sstevel@tonic-gate 347c478bd9Sstevel@tonic-gateROOTLIBTZSRCFILES= $(SRCFILES:%=$(ROOTTZSRCD)/%) 357c478bd9Sstevel@tonic-gateROOTLIBTZTABFILES= $(TABFILES:%=$(ROOTTZTABD)/%) 367c478bd9Sstevel@tonic-gateROOTKSHPROG= $(ROOTBIN)/$(KSHPROG) 377c478bd9Sstevel@tonic-gate 387c478bd9Sstevel@tonic-gate$(ROOTLIBTZSRCFILES):= FILEMODE= 0644 397c478bd9Sstevel@tonic-gate$(ROOTLIBTZTABFILES):= FILEMODE= 0644 407c478bd9Sstevel@tonic-gate 417c478bd9Sstevel@tonic-gate# 427c478bd9Sstevel@tonic-gate# Message catalog 437c478bd9Sstevel@tonic-gate# 447c478bd9Sstevel@tonic-gatePOFILE2=tzselect.po 457c478bd9Sstevel@tonic-gatePOFILE3=zoneinfo.po 467c478bd9Sstevel@tonic-gatePOFILES3=$(TABFILES) 477c478bd9Sstevel@tonic-gateTEXT_DOMAIN2=SUNW_OST_ZONEINFO 487c478bd9Sstevel@tonic-gateMSGDOMAIN2=$(MSGROOT)/$(TEXT_DOMAIN2) 497c478bd9Sstevel@tonic-gate 507c478bd9Sstevel@tonic-gate.KEEP_STATE: 517c478bd9Sstevel@tonic-gate 527c478bd9Sstevel@tonic-gateall: $(PROG) $(NPROG) $(KSHPROG) 537c478bd9Sstevel@tonic-gate 547c478bd9Sstevel@tonic-gate$(PROG): $(OBJS) 557c478bd9Sstevel@tonic-gate $(LINK.c) $(OBJS) -o $@ $(LDLIBS) 567c478bd9Sstevel@tonic-gate $(POST_PROCESS) 577c478bd9Sstevel@tonic-gate 587c478bd9Sstevel@tonic-gateinstall: all $(DIRS) $(ROOTTZSRCD) $(ROOTTZTABD) $(ROOTUSRSBINPROG) $(ROOTLIBTZSRCFILES) $(ROOTLIBTZTABFILES) $(ROOTKSHPROG) 597c478bd9Sstevel@tonic-gate $(NPROG) -d $(ROOTTZD) $(TZFILES) 607c478bd9Sstevel@tonic-gate 617c478bd9Sstevel@tonic-gate$(NPROG): $(NATIVE) $(NOBJS) 627c478bd9Sstevel@tonic-gate $(NATIVECC) -o $@ $(NOBJS) 637c478bd9Sstevel@tonic-gate 643b3f3420SRussell Blaine# 653b3f3420SRussell Blaine# XXX 663b3f3420SRussell Blaine# There is a .ksh rule in Makefile.targ, but we need our custom POFILE rules. 673b3f3420SRussell Blaine# 683b3f3420SRussell Blaine$(KSHPROG): $(KSHPROG).ksh 693b3f3420SRussell Blaine $(RM) $@ 703b3f3420SRussell Blaine $(CAT) $(KSHPROG).ksh > $@ 713b3f3420SRussell Blaine $(CHMOD) +x $@ 723b3f3420SRussell Blaine 737c478bd9Sstevel@tonic-gate$(ROOTTZSRCD)/%: % 747c478bd9Sstevel@tonic-gate $(INS.file) 757c478bd9Sstevel@tonic-gate 767c478bd9Sstevel@tonic-gate$(ROOTTZTABD)/%: % 777c478bd9Sstevel@tonic-gate $(INS.file) 787c478bd9Sstevel@tonic-gate 797c478bd9Sstevel@tonic-gate$(DIRS): 807c478bd9Sstevel@tonic-gate $(INS.dir) 817c478bd9Sstevel@tonic-gate 827c478bd9Sstevel@tonic-gate$(NATIVE): 837c478bd9Sstevel@tonic-gate -@mkdir -p $@ 847c478bd9Sstevel@tonic-gate 857c478bd9Sstevel@tonic-gateclean: 867c478bd9Sstevel@tonic-gate $(RM) $(OBJS) 877c478bd9Sstevel@tonic-gate 887c478bd9Sstevel@tonic-gatelint: lint_SRCS 897c478bd9Sstevel@tonic-gate 907c478bd9Sstevel@tonic-gate$(NOBJS): $$(@F:.o=.c) 917c478bd9Sstevel@tonic-gate $(NATIVECC) -O $(NCPPFLAGS) -c -o $@ $(@F:.o=.c) 927c478bd9Sstevel@tonic-gate 937c478bd9Sstevel@tonic-gate$(NATIVE)/zic.o: $(NATIVE)/tzfile.h 947c478bd9Sstevel@tonic-gate 957c478bd9Sstevel@tonic-gate#$(NATIVE)/scheck.o: scheck.c 967c478bd9Sstevel@tonic-gate# $(NATIVECC) -c -o $@ scheck.c 977c478bd9Sstevel@tonic-gate 987c478bd9Sstevel@tonic-gate#$(NATIVE)/ialloc.o: ialloc.c 997c478bd9Sstevel@tonic-gate# $(NATIVECC) -c -o $@ ialloc.c 1007c478bd9Sstevel@tonic-gate 1017c478bd9Sstevel@tonic-gate$(NATIVE)/tzfile.h: $(ROOT)/usr/include/tzfile.h 1027c478bd9Sstevel@tonic-gate $(RM) $@; cp $(ROOT)/usr/include/tzfile.h $@ 1037c478bd9Sstevel@tonic-gate 1047c478bd9Sstevel@tonic-gate# 1057c478bd9Sstevel@tonic-gate# From ../Makefile.targ 1067c478bd9Sstevel@tonic-gate# 1077c478bd9Sstevel@tonic-gateclobber: clean 1087c478bd9Sstevel@tonic-gate -$(RM) $(PROG) $(CLOBBERFILES) 1097c478bd9Sstevel@tonic-gate 1107c478bd9Sstevel@tonic-gatelint_PROG: 1117c478bd9Sstevel@tonic-gate $(LINT.c) $(PROG).c $(LDLIBS) 1127c478bd9Sstevel@tonic-gate 1137c478bd9Sstevel@tonic-gatelint_SRCS: 1147c478bd9Sstevel@tonic-gate $(LINT.c) $(SRCS) $(LDLIBS) 1157c478bd9Sstevel@tonic-gate 1167c478bd9Sstevel@tonic-gate# 1177c478bd9Sstevel@tonic-gate# For message catalogue files 1187c478bd9Sstevel@tonic-gate# 1197c478bd9Sstevel@tonic-gate_msg: $(MSGDOMAIN) $(POFILE) $(POFILE2) $(MSGDOMAIN2) $(POFILE3) 1207c478bd9Sstevel@tonic-gate $(RM) $(MSGDOMAIN)/$(POFILE) 1217c478bd9Sstevel@tonic-gate $(CP) $(POFILE) $(MSGDOMAIN) 1227c478bd9Sstevel@tonic-gate $(RM) $(MSGDOMAIN)/$(POFILE2) 1237c478bd9Sstevel@tonic-gate $(CP) $(POFILE2) $(MSGDOMAIN) 1247c478bd9Sstevel@tonic-gate $(RM) $(MSGDOMAIN2)/$(POFILE3) 1257c478bd9Sstevel@tonic-gate $(CP) $(POFILE3) $(MSGDOMAIN2)/$(POFILE3) 1267c478bd9Sstevel@tonic-gate 1277c478bd9Sstevel@tonic-gate$(MSGDOMAIN) $(DCMSGDOMAIN) $(MSGDOMAIN2): 1287c478bd9Sstevel@tonic-gate $(INS.dir) 1297c478bd9Sstevel@tonic-gate 1307c478bd9Sstevel@tonic-gate$(POFILE3): $(POFILES3) 1317c478bd9Sstevel@tonic-gate $(RM) $@ 1327c478bd9Sstevel@tonic-gate @/bin/sh ./do_pofile.sh > $@ 1337c478bd9Sstevel@tonic-gate 134