xref: /illumos-gate/usr/src/cmd/zic/Makefile (revision 99ba4d70906e5f67853c25ade6ebf4da3e5be4d6)
17c478bd9Sstevel@tonic-gate#
2*99ba4d70SRussell Blaine# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
3*99ba4d70SRussell 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-gateOWNER= root
247c478bd9Sstevel@tonic-gateGROUP= bin
257c478bd9Sstevel@tonic-gate
267c478bd9Sstevel@tonic-gateCLOBBERFILES= $(NOBJS) $(NPROG) $(NATIVE)/zic.c $(NATIVE)/tzfile.h
277c478bd9Sstevel@tonic-gate
287c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd
297c478bd9Sstevel@tonic-gate
307c478bd9Sstevel@tonic-gateNCPPFLAGS=	-I$(NATIVE)
317c478bd9Sstevel@tonic-gateROOTTZD=	$(ROOTSHLIB)/zoneinfo
327c478bd9Sstevel@tonic-gateROOTTZSRCD=	$(ROOTSHLIB)/zoneinfo/src
337c478bd9Sstevel@tonic-gateROOTTZTABD=	$(ROOTSHLIB)/zoneinfo/tab
347c478bd9Sstevel@tonic-gateDIRS=  $(ROOTTZSRCD) $(ROOTTZTABD)
357c478bd9Sstevel@tonic-gate
367c478bd9Sstevel@tonic-gateROOTLIBTZSRCFILES=	$(SRCFILES:%=$(ROOTTZSRCD)/%)
377c478bd9Sstevel@tonic-gateROOTLIBTZTABFILES=	$(TABFILES:%=$(ROOTTZTABD)/%)
387c478bd9Sstevel@tonic-gateROOTKSHPROG=	$(ROOTBIN)/$(KSHPROG)
397c478bd9Sstevel@tonic-gate
407c478bd9Sstevel@tonic-gate$(ROOTLIBTZSRCFILES):=	FILEMODE=	0644
417c478bd9Sstevel@tonic-gate$(ROOTLIBTZTABFILES):=	FILEMODE=	0644
427c478bd9Sstevel@tonic-gate
437c478bd9Sstevel@tonic-gate#
447c478bd9Sstevel@tonic-gate# Message catalog
457c478bd9Sstevel@tonic-gate#
467c478bd9Sstevel@tonic-gatePOFILE2=tzselect.po
477c478bd9Sstevel@tonic-gatePOFILE3=zoneinfo.po
487c478bd9Sstevel@tonic-gatePOFILES3=$(TABFILES)
497c478bd9Sstevel@tonic-gateTEXT_DOMAIN2=SUNW_OST_ZONEINFO
507c478bd9Sstevel@tonic-gateMSGDOMAIN2=$(MSGROOT)/$(TEXT_DOMAIN2)
517c478bd9Sstevel@tonic-gate
527c478bd9Sstevel@tonic-gate.KEEP_STATE:
537c478bd9Sstevel@tonic-gate
547c478bd9Sstevel@tonic-gateall: $(PROG) $(NPROG) $(KSHPROG)
557c478bd9Sstevel@tonic-gate
567c478bd9Sstevel@tonic-gate$(PROG): $(OBJS)
577c478bd9Sstevel@tonic-gate	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
587c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
597c478bd9Sstevel@tonic-gate
607c478bd9Sstevel@tonic-gateinstall: all $(DIRS) $(ROOTTZSRCD) $(ROOTTZTABD) $(ROOTUSRSBINPROG) $(ROOTLIBTZSRCFILES) $(ROOTLIBTZTABFILES) $(ROOTKSHPROG)
617c478bd9Sstevel@tonic-gate	$(NPROG) -d $(ROOTTZD) $(TZFILES)
627c478bd9Sstevel@tonic-gate	$(CH) $(CHOWN) -R $(OWNER) $(ROOTTZD)
637c478bd9Sstevel@tonic-gate	$(CH) $(CHGRP) -R $(GROUP) $(ROOTTZD)
647c478bd9Sstevel@tonic-gate
657c478bd9Sstevel@tonic-gate$(NPROG): $(NATIVE) $(NOBJS)
667c478bd9Sstevel@tonic-gate	$(NATIVECC) -o $@ $(NOBJS)
677c478bd9Sstevel@tonic-gate
687c478bd9Sstevel@tonic-gate$(ROOTTZSRCD)/%: %
697c478bd9Sstevel@tonic-gate	$(INS.file)
707c478bd9Sstevel@tonic-gate
717c478bd9Sstevel@tonic-gate$(ROOTTZTABD)/%: %
727c478bd9Sstevel@tonic-gate	$(INS.file)
737c478bd9Sstevel@tonic-gate
747c478bd9Sstevel@tonic-gate$(DIRS):
757c478bd9Sstevel@tonic-gate	$(INS.dir)
767c478bd9Sstevel@tonic-gate
777c478bd9Sstevel@tonic-gate$(NATIVE):
787c478bd9Sstevel@tonic-gate	-@mkdir -p $@
797c478bd9Sstevel@tonic-gate
807c478bd9Sstevel@tonic-gateclean:
817c478bd9Sstevel@tonic-gate	$(RM) $(OBJS)
827c478bd9Sstevel@tonic-gate
837c478bd9Sstevel@tonic-gatelint: lint_SRCS
847c478bd9Sstevel@tonic-gate
857c478bd9Sstevel@tonic-gate$(NOBJS): $$(@F:.o=.c)
867c478bd9Sstevel@tonic-gate	$(NATIVECC) -O $(NCPPFLAGS) -c -o $@ $(@F:.o=.c)
877c478bd9Sstevel@tonic-gate
887c478bd9Sstevel@tonic-gate$(NATIVE)/zic.o: $(NATIVE)/tzfile.h
897c478bd9Sstevel@tonic-gate
907c478bd9Sstevel@tonic-gate#$(NATIVE)/scheck.o: scheck.c
917c478bd9Sstevel@tonic-gate#	$(NATIVECC) -c -o $@ scheck.c
927c478bd9Sstevel@tonic-gate
937c478bd9Sstevel@tonic-gate#$(NATIVE)/ialloc.o: ialloc.c
947c478bd9Sstevel@tonic-gate#	$(NATIVECC) -c -o $@ ialloc.c
957c478bd9Sstevel@tonic-gate
967c478bd9Sstevel@tonic-gate$(NATIVE)/tzfile.h: $(ROOT)/usr/include/tzfile.h
977c478bd9Sstevel@tonic-gate	$(RM) $@; cp $(ROOT)/usr/include/tzfile.h $@
987c478bd9Sstevel@tonic-gate
997c478bd9Sstevel@tonic-gate#
1007c478bd9Sstevel@tonic-gate# From ../Makefile.targ
1017c478bd9Sstevel@tonic-gate#
1027c478bd9Sstevel@tonic-gateclobber: clean
1037c478bd9Sstevel@tonic-gate	-$(RM) $(PROG) $(CLOBBERFILES)
1047c478bd9Sstevel@tonic-gate
1057c478bd9Sstevel@tonic-gatelint_PROG:
1067c478bd9Sstevel@tonic-gate	$(LINT.c) $(PROG).c $(LDLIBS)
1077c478bd9Sstevel@tonic-gate
1087c478bd9Sstevel@tonic-gatelint_SRCS:
1097c478bd9Sstevel@tonic-gate	$(LINT.c) $(SRCS) $(LDLIBS)
1107c478bd9Sstevel@tonic-gate
1117c478bd9Sstevel@tonic-gate#
1127c478bd9Sstevel@tonic-gate# For message catalogue files
1137c478bd9Sstevel@tonic-gate#
1147c478bd9Sstevel@tonic-gate_msg: $(MSGDOMAIN) $(POFILE) $(POFILE2) $(MSGDOMAIN2) $(POFILE3)
1157c478bd9Sstevel@tonic-gate	$(RM) $(MSGDOMAIN)/$(POFILE)
1167c478bd9Sstevel@tonic-gate	$(CP) $(POFILE) $(MSGDOMAIN)
1177c478bd9Sstevel@tonic-gate	$(RM) $(MSGDOMAIN)/$(POFILE2)
1187c478bd9Sstevel@tonic-gate	$(CP) $(POFILE2) $(MSGDOMAIN)
1197c478bd9Sstevel@tonic-gate	$(RM) $(MSGDOMAIN2)/$(POFILE3)
1207c478bd9Sstevel@tonic-gate	$(CP) $(POFILE3) $(MSGDOMAIN2)/$(POFILE3)
1217c478bd9Sstevel@tonic-gate
1227c478bd9Sstevel@tonic-gate$(MSGDOMAIN) $(DCMSGDOMAIN) $(MSGDOMAIN2):
1237c478bd9Sstevel@tonic-gate	$(INS.dir)
1247c478bd9Sstevel@tonic-gate
1257c478bd9Sstevel@tonic-gate$(POFILE3):	$(POFILES3)
1267c478bd9Sstevel@tonic-gate	$(RM) $@
1277c478bd9Sstevel@tonic-gate	@/bin/sh ./do_pofile.sh > $@
1287c478bd9Sstevel@tonic-gate
129