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