1*880d7978SAlexander Pyhalov# 2*880d7978SAlexander Pyhalov# CDDL HEADER START 3*880d7978SAlexander Pyhalov# 4*880d7978SAlexander Pyhalov# The contents of this file are subject to the terms of the 5*880d7978SAlexander Pyhalov# Common Development and Distribution License (the "License"). 6*880d7978SAlexander Pyhalov# You may not use this file except in compliance with the License. 7*880d7978SAlexander Pyhalov# 8*880d7978SAlexander Pyhalov# You can obtain a copy of the license at src/OPENSOLARIS.LICENSE 9*880d7978SAlexander Pyhalov# or http://www.opensolaris.org/os/licensing. 10*880d7978SAlexander Pyhalov# See the License for the specific language governing permissions 11*880d7978SAlexander Pyhalov# and limitations under the License. 12*880d7978SAlexander Pyhalov# 13*880d7978SAlexander Pyhalov# When distributing Covered Code, include this CDDL HEADER in each 14*880d7978SAlexander Pyhalov# file and include the License file at src/OPENSOLARIS.LICENSE. 15*880d7978SAlexander Pyhalov# If applicable, add the following below this CDDL HEADER, with the 16*880d7978SAlexander Pyhalov# fields enclosed by brackets "[]" replaced with your own identifying 17*880d7978SAlexander Pyhalov# information: Portions Copyright [yyyy] [name of copyright owner] 18*880d7978SAlexander Pyhalov# 19*880d7978SAlexander Pyhalov# CDDL HEADER END 20*880d7978SAlexander Pyhalov# 21*880d7978SAlexander Pyhalov# 22*880d7978SAlexander Pyhalov# 23*880d7978SAlexander Pyhalov# Copyright 2006 Sun Microsystems, Inc. All rights reserved. 24*880d7978SAlexander Pyhalov# Use is subject to license terms. 25*880d7978SAlexander Pyhalov# 26*880d7978SAlexander Pyhalov 27*880d7978SAlexander Pyhalov# common makefile to handle the most common parts of code: i.e. 28*880d7978SAlexander Pyhalov# copying static files from the src dir to the proto dir. 29*880d7978SAlexander Pyhalov 30*880d7978SAlexander Pyhalovinclude $(SRC)/Makefile.master 31*880d7978SAlexander Pyhalov 32*880d7978SAlexander Pyhalovall:= TARGET= all 33*880d7978SAlexander Pyhalovinstall := TARGET= install 34*880d7978SAlexander Pyhalovclean := TARGET= clean 35*880d7978SAlexander Pyhalovclobber := TARGET= clobber 36*880d7978SAlexander Pyhalov 37*880d7978SAlexander PyhalovOBJS = $(SRCS:%.c=%.o) 38*880d7978SAlexander PyhalovPROGS = $(OBJS:%.o=%.so) 39*880d7978SAlexander Pyhalov 40*880d7978SAlexander PyhalovCREATE_LINKS = .links_created 41*880d7978SAlexander Pyhalov 42*880d7978SAlexander PyhalovCLEANFILES = *.o *.so.* *.so $(CREATE_LINKS) 43*880d7978SAlexander Pyhalov 44*880d7978SAlexander PyhalovPROTOCLEANFILES = $(ICONV_LIBS) $(ICONV_LIBS_64) 45*880d7978SAlexander Pyhalov 46*880d7978SAlexander PyhalovCFLAGS += -I../../inc -I. -I../../common $(C_PICFLAGS) $(GSHARED) 47*880d7978SAlexander PyhalovCFLAGS += -I$(ADJUNCT_PROTO)/usr/include 48*880d7978SAlexander Pyhalov 49*880d7978SAlexander PyhalovDYNFLAGS= $(GSHARED) $(ZTEXT) $(ZDEFS) $(BDIRECT) \ 50*880d7978SAlexander Pyhalov $(MAPFILES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%) 51*880d7978SAlexander Pyhalov 52*880d7978SAlexander PyhalovLDLIBS= -lc 53*880d7978SAlexander Pyhalov 54*880d7978SAlexander PyhalovICONV_DIR = $(ROOT)/usr/lib/iconv 55*880d7978SAlexander Pyhalov 56*880d7978SAlexander PyhalovICONV_DIR_64 = $(ROOT)/usr/lib/iconv/$(MACH64) 57*880d7978SAlexander Pyhalov 58*880d7978SAlexander PyhalovICONV_LIBS = $(PROGS:%=$(ICONV_DIR)/%) 59*880d7978SAlexander Pyhalov 60*880d7978SAlexander PyhalovICONV_LIBS_64 = $(PROGS:%=$(ICONV_DIR_64)/%) 61*880d7978SAlexander Pyhalov 62*880d7978SAlexander Pyhalov$(ICONV_LIBS) := FILEMODE= 755 63*880d7978SAlexander Pyhalov 64*880d7978SAlexander Pyhalov$(ICONV_LIBS_64) := FILEMODE= 755 65*880d7978SAlexander Pyhalov 66*880d7978SAlexander Pyhalov$(ICONV_DIR) $(ICONV_DIR_64): 67*880d7978SAlexander Pyhalov $(INS.dir) $@ 68*880d7978SAlexander Pyhalov 69*880d7978SAlexander Pyhalov$(ICONV_DIR)/%: % 70*880d7978SAlexander Pyhalov $(INS.file) 71*880d7978SAlexander Pyhalov 72*880d7978SAlexander Pyhalov$(ICONV_DIR_64)/%: % 73*880d7978SAlexander Pyhalov $(INS.file) 74*880d7978SAlexander Pyhalov 75*880d7978SAlexander Pyhalov$(ICONV_DIR)/%: ../% 76*880d7978SAlexander Pyhalov $(INS.file) 77*880d7978SAlexander Pyhalov 78*880d7978SAlexander Pyhalov%.so: %.o 79*880d7978SAlexander Pyhalov $(CC) $(CFLAGS) $(DYNFLAGS) $(LDLIBS) -o $@ $(@:%.so=%.o) 80*880d7978SAlexander Pyhalov $(POST_PROCESS_SO) 81*880d7978SAlexander Pyhalov 82*880d7978SAlexander Pyhalov%.o: ../%.c 83*880d7978SAlexander Pyhalov $(CC) $(CFLAGS) -c -o $@ $(@:%.o=../%.c) 84*880d7978SAlexander Pyhalov $(POST_PROCESS_O) 85*880d7978SAlexander Pyhalov 86*880d7978SAlexander Pyhalov%.o: ../common/%.c 87*880d7978SAlexander Pyhalov $(CC) $(CFLAGS) -c -o $@ $(@:%.o=../common/%.c) 88*880d7978SAlexander Pyhalov $(POST_PROCESS_O) 89*880d7978SAlexander Pyhalov 90*880d7978SAlexander Pyhalov%.o: %.c 91*880d7978SAlexander Pyhalov $(CC) $(CFLAGS) -c -o $@ $(@:%.o=%.c) 92*880d7978SAlexander Pyhalov $(POST_PROCESS_O) 93*880d7978SAlexander Pyhalov 94*880d7978SAlexander Pyhalovlint: FRC 95*880d7978SAlexander Pyhalov 96*880d7978SAlexander Pyhalovclean: 97*880d7978SAlexander Pyhalov $(RM) $(CLEANFILES) 98*880d7978SAlexander Pyhalov 99*880d7978SAlexander Pyhalovclobber: clean 100*880d7978SAlexander Pyhalov $(RM) $(PROTOCLEANFILES) 101*880d7978SAlexander Pyhalov 102*880d7978SAlexander PyhalovFRC: 103