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 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 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#
22#
23# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26
27# common makefile to handle the most common parts of code: i.e.
28# copying static files from the src dir to the proto dir.
29
30include $(SRC)/Makefile.master
31
32all:=		TARGET= all
33install :=	TARGET= install
34clean :=	TARGET= clean
35clobber :=	TARGET= clobber
36
37OBJS		= $(SRCS:%.c=%.o)
38PROGS		= $(OBJS:%.o=%.so)
39
40CREATE_LINKS = .links_created
41
42CLEANFILES	= *.o *.so.* *.so $(CREATE_LINKS)
43
44PROTOCLEANFILES = $(ICONV_LIBS) $(ICONV_LIBS_64)
45
46CPPFLAGS	+= -I../../inc -I. -I../../common
47CFLAGS		+= $(C_PICFLAGS) $(GSHARED)
48
49DYNFLAGS=	$(GSHARED) $(ZTEXT) $(ZDEFS) $(BDIRECT) \
50		$(MAPFILES:%=-Wl,-M%) $(MAPFILE.PGA:%=-Wl,-M%) $(MAPFILE.NED:%=-Wl,-M%)
51
52LDLIBS=		-lc
53
54ICONV_DIR	= $(ROOT)/usr/lib/iconv
55
56ICONV_DIR_64	= $(ROOT)/usr/lib/iconv/$(MACH64)
57
58ICONV_LIBS	= $(PROGS:%=$(ICONV_DIR)/%)
59
60ICONV_LIBS_64	= $(PROGS:%=$(ICONV_DIR_64)/%)
61
62$(ICONV_LIBS) :=      FILEMODE= 755
63
64$(ICONV_LIBS_64) :=      FILEMODE= 755
65
66$(ICONV_DIR) $(ICONV_DIR_64):
67	$(INS.dir) $@
68
69$(ICONV_DIR)/%: %
70	$(INS.file)
71
72$(ICONV_DIR_64)/%: %
73	$(INS.file)
74
75$(ICONV_DIR)/%: ../%
76	$(INS.file)
77
78%.so: %.o
79	$(CC) $(CFLAGS) $(DYNFLAGS) $(LDLIBS) -o $@ $(@:%.so=%.o)
80	$(POST_PROCESS_SO)
81
82%.o: ../%.c
83	$(COMPILE.c) $(CFLAGS) -o $@ $<
84	$(POST_PROCESS_O)
85
86%.o: ../common/%.c
87	$(COMPILE.c) $(CFLAGS) -o $@ $<
88	$(POST_PROCESS_O)
89
90%.o: %.c
91	$(COMPILE.c) $(CFLAGS) -o $@ $<
92	$(POST_PROCESS_O)
93
94clean:
95	$(RM) $(CLEANFILES)
96
97clobber: clean
98	$(RM) $(PROTOCLEANFILES)
99
100FRC:
101