1 # 2 # Copyright 2009 Sun Microsystems, Inc. All rights reserved. 3 # Use is subject to license terms. 4 # 5 6 NATIVE=native 7 PROG= zic 8 KSHPROG= tzselect 9 NPROG= $(NATIVE)/$(PROG) 10 11 # "etcetera" must be listed before "backward" because it sets up links that 12 # "backward" needs. 13 TZFILES= africa antarctica asia australasia etcetera europe \ 14 factory northamerica pacificnew solar87 solar88 solar89 \ 15 southamerica backward 16 # Don't build the systemv timezones, but do install the source file. 17 SRCFILES = $(TZFILES) systemv README 18 TABFILES = continent.tab country.tab zone_sun.tab 19 20 OBJS= zic.o scheck.o ialloc.o 21 SRCS= $(OBJS:%.o=%.c) 22 NOBJS= $(OBJS:%=$(NATIVE)/%) 23 24 CLOBBERFILES= $(NOBJS) $(KSHPROG) $(NPROG) $(NATIVE)/zic.c $(NATIVE)/tzfile.h 25 26 include ../Makefile.cmd 27 28 NCPPFLAGS= -I$(NATIVE) 29 ROOTTZD= $(ROOTSHLIB)/zoneinfo 30 ROOTTZSRCD= $(ROOTSHLIB)/zoneinfo/src 31 ROOTTZTABD= $(ROOTSHLIB)/zoneinfo/tab 32 DIRS= $(ROOTTZSRCD) $(ROOTTZTABD) 33 34 CERRWARN += -_gcc=-Wno-unused-variable 35 CERRWARN += -_gcc=-Wno-uninitialized 36 37 ROOTLIBTZSRCFILES= $(SRCFILES:%=$(ROOTTZSRCD)/%) 38 ROOTLIBTZTABFILES= $(TABFILES:%=$(ROOTTZTABD)/%) 39 ROOTKSHPROG= $(ROOTBIN)/$(KSHPROG) 40 41 $(ROOTLIBTZSRCFILES):= FILEMODE= 0644 42 $(ROOTLIBTZTABFILES):= FILEMODE= 0644 43 44 # 45 # Message catalog 46 # 47 POFILE2=tzselect.po 48 POFILE3=zoneinfo.po 49 POFILES3=$(TABFILES) 50 TEXT_DOMAIN2=SUNW_OST_ZONEINFO 51 MSGDOMAIN2=$(MSGROOT)/$(TEXT_DOMAIN2) 52 53 # NB: $(POFILE2) is under SCM. 54 CLOBBERFILES += $(POFILE) $(POFILE3) 55 56 .KEEP_STATE: 57 58 all: $(PROG) $(NPROG) $(KSHPROG) 59 60 $(PROG): $(OBJS) 61 $(LINK.c) $(OBJS) -o $@ $(LDLIBS) 62 $(POST_PROCESS) 63 64 install: all $(DIRS) $(ROOTTZSRCD) $(ROOTTZTABD) $(ROOTUSRSBINPROG) \ 65 $(ROOTLIBTZSRCFILES) $(ROOTLIBTZTABFILES) $(ROOTKSHPROG) 66 $(NPROG) -d $(ROOTTZD) $(TZFILES) 67 68 $(NPROG): $(NATIVE) $(NOBJS) 69 $(NATIVECC) $(NATIVE_CFLAGS) -o $@ $(NOBJS) 70 71 # 72 # XXX 73 # There is a .ksh rule in Makefile.targ, but we need our custom POFILE rules. 74 # 75 $(KSHPROG): $(KSHPROG).ksh 76 $(RM) $@ 77 $(CAT) $(KSHPROG).ksh > $@ 78 $(CHMOD) +x $@ 79 80 $(ROOTTZSRCD)/%: % 81 $(INS.file) 82 83 $(ROOTTZTABD)/%: % 84 $(INS.file) 85 86 $(DIRS): 87 $(INS.dir) 88 89 $(NATIVE): 90 -@mkdir -p $@ 91 92 clean: 93 $(RM) $(OBJS) 94 95 lint: lint_SRCS 96 97 $(NOBJS): $$(@F:.o=.c) 98 $(NATIVECC) -O $(NATIVE_CFLAGS) $(NCPPFLAGS) -c -o $@ $(@F:.o=.c) 99 100 $(NATIVE)/zic.o: $(NATIVE)/tzfile.h 101 102 $(NATIVE)/tzfile.h: $(ROOT)/usr/include/tzfile.h 103 $(RM) $@; cp $(ROOT)/usr/include/tzfile.h $@ 104 105 # 106 # From ../Makefile.targ 107 # 108 clobber: clean 109 -$(RM) $(PROG) $(CLOBBERFILES) 110 111 lint_PROG: 112 $(LINT.c) $(PROG).c $(LDLIBS) 113 114 lint_SRCS: 115 $(LINT.c) $(SRCS) $(LDLIBS) 116 117 # 118 # For message catalogue files 119 # 120 _msg: $(MSGDOMAIN) $(POFILE) $(POFILE2) $(MSGDOMAIN2) $(POFILE3) 121 $(RM) $(MSGDOMAIN)/$(POFILE) 122 $(CP) $(POFILE) $(MSGDOMAIN) 123 $(RM) $(MSGDOMAIN)/$(POFILE2) 124 $(CP) $(POFILE2) $(MSGDOMAIN) 125 $(RM) $(MSGDOMAIN2)/$(POFILE3) 126 $(CP) $(POFILE3) $(MSGDOMAIN2)/$(POFILE3) 127 128 $(MSGDOMAIN) $(DCMSGDOMAIN) $(MSGDOMAIN2): 129 $(INS.dir) 130 131 $(POFILE3): $(POFILES3) 132 $(RM) $@ 133 @/bin/sh ./do_pofile.sh > $@ 134