1 #
2 # CDDL HEADER START
3 #
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
7 #
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
12 #
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 #
19 # CDDL HEADER END
20 #
21 # Copyright 2005 Sun Microsystems, Inc. All rights reserved.
22 # Use is subject to license terms.
23 #
24 # @(#)Variant.mk 1.36 06/12/12
25 #
26
27 TOP = ../../../../..
28 include $(TOP)/rules/master.mk
29 include $(TOP)/Make/lib/Lib.mk
30
31 # RELEASE_VER should be "Generic" for FCS. Otherwise it should be overridden
32 # to display build number - "Build XX", patch number - "Patch XXXXXX-XX", etc.
33
34 PKG_TOP = ../../../..
35 PROG = make
36 PACKAGE = SUNWspro
37 PRODVER = 11
38 PRODVER_V = SunOS 5.11
39 RELEASE_VER = Generic
40 DATE:sh = date '+%B %Y'
41
42 VERSTRING = RELEASE VERSION $(PRODVER_V) $(RELEASE_VER) $(DATE)
43
44 MORE_SRC = \
45 ar.cc \
46 depvar.cc \
47 doname.cc \
48 dosys.cc \
49 files.cc \
50 globals.cc \
51 implicit.cc \
52 macro.cc \
53 main.cc \
54 misc.cc \
55 nse_printdep.cc \
56 read.cc \
57 read2.cc \
58 rep.cc \
59 state.cc
60
61 CPPFLAGS += -I$(PKG_TOP)/include
62
63 LDLIB += \
64 -lnsl \
65 -lsocket \
66 -lw
67
68 HDRS_DIR = $(PKG_TOP)/include/mk
69 HDRS_LIST = $(HDRS_DIR)/copyright.h $(HDRS_DIR)/defs.h
70
71 .INIT: $(HDRS_LIST)
72
73 SRCS = $(PROG).cc $(MORE_SRC)
74 OBJS = $(SRCS:%.cc=%.o)
75
76 LIB += -lintl -lm
77
78 all install:: $(PROG)
79
80 $(PROG): $(OBJS)
81 $(CCC) $(CCFLAGS) $(LDFLAGS) -o $@ \
82 $(OBJS) $(LIB) $(I18LIB) $(LDLIB)
83 /bin/sh $(TOP)/exe/sanity-check.sh $(TOP) $(PROG)
84
85 clean:
86 $(RM) $(OBJS) $(PROG)
87
88
89 include $(TOP)/rules/computed-options.mk
90
91 #
92 # This LIB macro must be declared after the include's above
93 #
94 LIB = \
95 $(LIBMKSH) \
96 $(LIBMKSDMSI18N) \
97 $(LIBBSD) \
98 $(LIBVROOT)
99
100 %.o: ../../common/%.cc
101 $(COMPILE.cc) $(OUTPUT_OPTION) $<
102
103 depvar.o nse.o nse_printdep.o := CPPFLAGS += -DSUNOS4_AND_AFTER
104
105 LDFLAGS += -xildoff -norunpath
106
107 install:: install-make-hdrs install-make-bin
108
109 IHDR = make.rules.file
110 VIHDR = svr4.make.rules.file
111 HDR = ${PKG_TOP}/bin/make/common/make.rules.file
112 VHDR = ${PKG_TOP}/bin/make/common/svr4.make.rules.file
113 HDRSDIR = $(DESTDIR)/usr/share/lib/make
114 HDRFILE = make.rules
115 VHDRFILE = svr4.make.rules
116 SMAKEDIR = $(DESTDIR)/usr/ccs/bin
117
118 install-make-bin: make
119 $(INSTALL) -d $(SMAKEDIR)
120 $(INSTALL) make $(SMAKEDIR)
121 mcs -d $(SMAKEDIR)/make
122 mcs -a '@(#)$(VERSTRING)' $(SMAKEDIR)/make
123
124 install-make-hdrs: $(HDR) $(VHDR)
125 $(INSTALL) -d $(HDRSDIR)
126 $(INSTALL) -m 0444 $(HDR) $(HDRSDIR)
127 mv -f $(HDRSDIR)/$(IHDR) $(HDRSDIR)/$(HDRFILE)
128 $(INSTALL) -m 0444 $(VHDR) $(HDRSDIR)
129 mv -f $(HDRSDIR)/$(VIHDR) $(HDRSDIR)/$(VHDRFILE)
130
131
132 #
133 # i18n stuff
134 #
135 MAKE_MSG = SUNW_SPRO_MAKE.msg
136 #I18N_DIRS = ../../common ../../../../lib/bsd/src ../../../../lib/mksh/src ../../../../lib/vroot/src
137 I18N_DIRS = ../../common
138 TEXTDOMAIN = SUNW_SPRO_MAKE
139 APPPATH = $(PKG_TOP)/bin/make/smake/$(VARIANT)
140 LIB_DESTDIR = $(DESTDIR)/usr/lib
141 CAT_DESTDIR = $(LIB_DESTDIR)/locale/C/LC_MESSAGES
142
143 $(CAT_DESTDIR):
144 $(INSTALL) -d $@
145
146 msg_catalogs: $(CAT_DESTDIR) .WAIT MAKE_MSG
147 cp $(APPPATH)/$(TEXTDOMAIN).msg $(CAT_DESTDIR)
148
149 MAKE_MSG:
150 $(GENMSG) -l $(SRC)/genmsg.project -o $(TEXTDOMAIN).msg `find $(I18N_DIRS) \( -name '*.cc' -o -name '*.c' -o -name '*.y' -o -name '*.h' \) -print | grep -v /SCCS/`
151 rm -f *.cc.new
152
153 i18n_install: msg_catalogs
154
155 FRC: