17c478bd9Sstevel@tonic-gate# 2f4b3ec61Sdh155122# CDDL HEADER START 3f4b3ec61Sdh155122# 4f4b3ec61Sdh155122# The contents of this file are subject to the terms of the 5f4b3ec61Sdh155122# Common Development and Distribution License (the "License"). 6f4b3ec61Sdh155122# You may not use this file except in compliance with the License. 7f4b3ec61Sdh155122# 8f4b3ec61Sdh155122# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9f4b3ec61Sdh155122# or http://www.opensolaris.org/os/licensing. 10f4b3ec61Sdh155122# See the License for the specific language governing permissions 11f4b3ec61Sdh155122# and limitations under the License. 12f4b3ec61Sdh155122# 13f4b3ec61Sdh155122# When distributing Covered Code, include this CDDL HEADER in each 14f4b3ec61Sdh155122# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15f4b3ec61Sdh155122# If applicable, add the following below this CDDL HEADER, with the 16f4b3ec61Sdh155122# fields enclosed by brackets "[]" replaced with your own identifying 17f4b3ec61Sdh155122# information: Portions Copyright [yyyy] [name of copyright owner] 18f4b3ec61Sdh155122# 19f4b3ec61Sdh155122# CDDL HEADER END 20f4b3ec61Sdh155122# 21f4b3ec61Sdh155122# 22*d6c23f6fSyx160601# Copyright 2008 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate# Use is subject to license terms. 247c478bd9Sstevel@tonic-gate# 257c478bd9Sstevel@tonic-gate# 26734b6a94Sdarrenm# ident "%Z%%M% %I% %E% SMI" 277c478bd9Sstevel@tonic-gate# 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gatePROG= ipf ipfs ipmon ipnat ippool ipfstat 307c478bd9Sstevel@tonic-gateIPFPROG= ipftest 317c478bd9Sstevel@tonic-gate 327c478bd9Sstevel@tonic-gateIPF_OBJS= ipf.o ipfcomp.o ipf_y.o ipf_l.o 337c478bd9Sstevel@tonic-gateIPFS_OBJS= ipfs.o 347c478bd9Sstevel@tonic-gateIPFSTAT_OBJS= ipfstat.o 357c478bd9Sstevel@tonic-gateIPMON_OBJS= ipmon.o ipmon_y.o ipmon_l.o 367c478bd9Sstevel@tonic-gateIPNAT_OBJS= ipnat.o ipnat_y.o ipnat_l.o 377c478bd9Sstevel@tonic-gateIPPOOL_OBJS= ippool.o ippool_y.o ippool_l.o 387c478bd9Sstevel@tonic-gateIPFTEST_OBJS= ipftest.o \ 39*d6c23f6fSyx160601 ip_fil.o ip_state.o ip_compat.o \ 40*d6c23f6fSyx160601 ip_frag.o ip_nat.o ip_nat6.o fil.o \ 417c478bd9Sstevel@tonic-gate ip_htable.o ip_lookup.o \ 427c478bd9Sstevel@tonic-gate ip_proxy.o ip_auth.o ip_log.o \ 437c478bd9Sstevel@tonic-gate ipf_y.o ipf_l.o \ 447c478bd9Sstevel@tonic-gate ipnat_y.o ipnat_l.o \ 457c478bd9Sstevel@tonic-gate ippool_y.o ippool_l.o \ 467c478bd9Sstevel@tonic-gate ip_pool.o radix.o 477c478bd9Sstevel@tonic-gate 487c478bd9Sstevel@tonic-gateOBJS= $(IPF_OBJS) $(IPFS_OBJS) $(IPFSTAT_OBJS) \ 497c478bd9Sstevel@tonic-gate $(IPMON_OBJS) $(IPNAT_OBJS) $(IPFTEST_OBJS) 507c478bd9Sstevel@tonic-gate 517c478bd9Sstevel@tonic-gateOBJSL= $(IPF_OBJS) $(IPFS_OBJS) $(IPFSTAT_OBJS) \ 527c478bd9Sstevel@tonic-gate $(IPMON_OBJS) $(IPNAT_OBJS) 537c478bd9Sstevel@tonic-gate 547c478bd9Sstevel@tonic-gateSRCS= $(OBJSL:%.o=../%.c) 557c478bd9Sstevel@tonic-gate 567c478bd9Sstevel@tonic-gateinclude ../../../Makefile.cmd 577c478bd9Sstevel@tonic-gateinclude ../../Makefile.ipf 587c478bd9Sstevel@tonic-gate 597c478bd9Sstevel@tonic-gateLDLIBS += $(LIBBPF) 6024da5b34SrieLDFLAGS += $(MAPFILE.NGB:%=-M%) 617c478bd9Sstevel@tonic-gate 627c478bd9Sstevel@tonic-gateCPPFLAGS += -I. -DIPFILTER_LOOKUP -DIPFILTER_LOG 637c478bd9Sstevel@tonic-gate 647c478bd9Sstevel@tonic-gateipfstat.o := CPPFLAGS += -DSTATETOP 657c478bd9Sstevel@tonic-gateipfstat := LDLIBS += -lcurses 667c478bd9Sstevel@tonic-gate 677c478bd9Sstevel@tonic-gateipf := LDLIBS += -lsocket -lnsl 68734b6a94Sdarrenmipftest := LDLIBS += -lsocket -lnsl -lmd 697c478bd9Sstevel@tonic-gateipfstat := LDLIBS += -lsocket -lnsl -lkvm -lelf 707c478bd9Sstevel@tonic-gateipmon := LDLIBS += -lsocket -lnsl 717c478bd9Sstevel@tonic-gateipnat := LDLIBS += -lsocket -lnsl -lkvm -lelf 72f4b3ec61Sdh155122ippool := LDLIBS += -lsocket -lnsl -lkvm -lelf 737c478bd9Sstevel@tonic-gate 747c478bd9Sstevel@tonic-gateCLEANFILES += $(OBJS) 757c478bd9Sstevel@tonic-gate 767c478bd9Sstevel@tonic-gateROOTIPF= $(ROOTLIB)/ipf 777c478bd9Sstevel@tonic-gateROOTIPF32= $(ROOTIPF)/$(MACH32) 787c478bd9Sstevel@tonic-gateROOTIPF64= $(ROOTIPF)/$(MACH64) 797c478bd9Sstevel@tonic-gate 807c478bd9Sstevel@tonic-gateROOTIPFPROG32= $(IPFPROG:%=$(ROOTIPF32)/%) 817c478bd9Sstevel@tonic-gateROOTIPFPROG64= $(IPFPROG:%=$(ROOTIPF64)/%) 827c478bd9Sstevel@tonic-gate 837c478bd9Sstevel@tonic-gateROOTIPFLINKS= $(IPFPROG:%=$(ROOTIPF)/%) 847c478bd9Sstevel@tonic-gateROOTUSRSBINLINKS= $(PROG:%=$(ROOTUSRSBIN)/%) 857c478bd9Sstevel@tonic-gate 867c478bd9Sstevel@tonic-gate$(ROOTIPF32): 877c478bd9Sstevel@tonic-gate $(INS.dir) 887c478bd9Sstevel@tonic-gate 897c478bd9Sstevel@tonic-gate$(ROOTIPF64): 907c478bd9Sstevel@tonic-gate $(INS.dir) 917c478bd9Sstevel@tonic-gate 927c478bd9Sstevel@tonic-gate$(ROOTIPF)/%: % 937c478bd9Sstevel@tonic-gate $(INS.file) 947c478bd9Sstevel@tonic-gate 957c478bd9Sstevel@tonic-gate$(ROOTIPF32)/%: % 967c478bd9Sstevel@tonic-gate $(INS.file) 977c478bd9Sstevel@tonic-gate 987c478bd9Sstevel@tonic-gate$(ROOTIPF64)/%: % 997c478bd9Sstevel@tonic-gate $(INS.file) 1007c478bd9Sstevel@tonic-gate 1017c478bd9Sstevel@tonic-gate$(ROOTUSRSBINLINKS): FRC 1027c478bd9Sstevel@tonic-gate -$(RM) $@; $(LN) $(ISAEXEC) $@ 1037c478bd9Sstevel@tonic-gate 1047c478bd9Sstevel@tonic-gate$(ROOTIPFLINKS): FRC 1057c478bd9Sstevel@tonic-gate -$(RM) $@; $(LN) $(ISAEXEC) $@ 1067c478bd9Sstevel@tonic-gate 1077c478bd9Sstevel@tonic-gate 1087c478bd9Sstevel@tonic-gate.KEEP_STATE: 1097c478bd9Sstevel@tonic-gate 11024da5b34Srieipf: $(IPF_OBJS) $(LIBIPF) $(MAPFILE.NGB) 1117c478bd9Sstevel@tonic-gate $(LINK.c) -o ipf $(IPF_OBJS) $(LDLIBS) 1127c478bd9Sstevel@tonic-gate $(POST_PROCESS) 1137c478bd9Sstevel@tonic-gate 114ab25eeb5Syz155240ipf_y.o: ../ipf_y.c $(COMMONIPF)/netinet/ip_fil.h $(COMMONIPF)/ipf.h \ 1157c478bd9Sstevel@tonic-gate ../ipf_y.c ../ipf_l.h 1167c478bd9Sstevel@tonic-gate 1177c478bd9Sstevel@tonic-gate../ipf_y.c ../ipf_y.h: ../ipf_y.y 1187c478bd9Sstevel@tonic-gate $(YACC) -d -b ipf ../ipf_y.y 1197c478bd9Sstevel@tonic-gate sed -e 's/yy/ipf_yy/g' -e 's/y.tab.h/ipf_y.c/' \ 1207c478bd9Sstevel@tonic-gate ipf.tab.c > ../ipf_y.c 1217c478bd9Sstevel@tonic-gate sed -e 's/yy/ipf_yy/g' -e 's/y.tab.h/ipf_y.h/' \ 1227c478bd9Sstevel@tonic-gate ipf.tab.h > ../ipf_y.h 1237c478bd9Sstevel@tonic-gate 124ab25eeb5Syz155240ipf_l.o: ../ipf_l.c $(COMMONIPF)/netinet/ip_fil.h $(COMMONIPF)/ipf.h \ 1257c478bd9Sstevel@tonic-gate ../ipf_y.h ../ipf_l.h 1267c478bd9Sstevel@tonic-gate $(COMPILE.c) ../ipf_l.c -o $@ 1277c478bd9Sstevel@tonic-gate 128ab25eeb5Syz155240../ipf_l.c: ../lexer.c $(COMMONIPF)/ipf.h $(COMMONIPF)/netinet/ip_fil.h 1297c478bd9Sstevel@tonic-gate sed -e 's/yy/ipf_yy/g' -e 's/y.tab.h/ipf_y.h/' \ 1307c478bd9Sstevel@tonic-gate -e 's/lexer.h/ipf_l.h/' ../lexer.c > $@ 1317c478bd9Sstevel@tonic-gate 1327c478bd9Sstevel@tonic-gate../ipf_l.h: ../lexer.h 1337c478bd9Sstevel@tonic-gate sed -e 's/yy/ipf_yy/g' ../lexer.h > $@ 1347c478bd9Sstevel@tonic-gate 1357c478bd9Sstevel@tonic-gateipfs: $(IPFS_OBJS) 1367c478bd9Sstevel@tonic-gate $(LINK.c) -o ipfs $(IPFS_OBJS) $(LDLIBS) 1377c478bd9Sstevel@tonic-gate $(POST_PROCESS) 1387c478bd9Sstevel@tonic-gate 13924da5b34Srieipfstat: $(IPFSTAT_OBJS) $(MAPFILE.NGB) 1407c478bd9Sstevel@tonic-gate $(LINK.c) -o ipfstat $(IPFSTAT_OBJS) $(LDLIBS) 1417c478bd9Sstevel@tonic-gate $(POST_PROCESS) 1427c478bd9Sstevel@tonic-gate 14324da5b34Srieipmon: $(IPMON_OBJS) $(LIBIPF) $(MAPFILE.NGB) 1447c478bd9Sstevel@tonic-gate $(LINK.c) -o ipmon $(IPMON_OBJS) $(LDLIBS) 1457c478bd9Sstevel@tonic-gate $(POST_PROCESS) 1467c478bd9Sstevel@tonic-gate 1477c478bd9Sstevel@tonic-gateipmon_y.o: ../ipmon_y.c $(COMMONIPF)/ipmon.h \ 1487c478bd9Sstevel@tonic-gate ../ipmon_y.h ../ipmon_l.h 1497c478bd9Sstevel@tonic-gate 1507c478bd9Sstevel@tonic-gate../ipmon_y.c ../ipmon_y.h: ../ipmon_y.y 1517c478bd9Sstevel@tonic-gate $(YACC) -d -b ipmon ../ipmon_y.y 1527c478bd9Sstevel@tonic-gate sed -e 's/yy/ipmon_yy/g' \ 1537c478bd9Sstevel@tonic-gate -e 's/extern [a-z]* .*();//' \ 1547c478bd9Sstevel@tonic-gate -e 's/^\(static [a-z]* .*\)();/\1(void);/' \ 1557c478bd9Sstevel@tonic-gate ipmon.tab.c > ../ipmon_y.c 1567c478bd9Sstevel@tonic-gate sed -e 's/yy/ipmon_yy/g' -e 's/y.tab.h/ipmon_y.h/' \ 1577c478bd9Sstevel@tonic-gate ipmon.tab.h > ../ipmon_y.h 1587c478bd9Sstevel@tonic-gate 1597c478bd9Sstevel@tonic-gateipmon_l.o: ../ipmon_l.c $(COMMONIPF)/ipmon.h ../ipmon_y.h ../ipmon_l.h 1607c478bd9Sstevel@tonic-gate $(COMPILE.c) ../ipmon_l.c -o $@ 1617c478bd9Sstevel@tonic-gate 1627c478bd9Sstevel@tonic-gate../ipmon_l.c: ../lexer.c $(COMMONIPF)/ipmon.h 1637c478bd9Sstevel@tonic-gate sed -e 's/yy/ipmon_yy/g' -e 's/y.tab.h/ipmon_y.h/' \ 1647c478bd9Sstevel@tonic-gate -e 's/lexer.h/ipmon_l.h/' ../lexer.c > $@ 1657c478bd9Sstevel@tonic-gate 1667c478bd9Sstevel@tonic-gate../ipmon_l.h: ../lexer.h 1677c478bd9Sstevel@tonic-gate sed -e 's/yy/ipmon_yy/g' ../lexer.h > $@ 1687c478bd9Sstevel@tonic-gate 16924da5b34Srieipnat: $(IPNAT_OBJS) $(LIBIPF) $(MAPFILE.NGB) 1707c478bd9Sstevel@tonic-gate $(LINK.c) -o ipnat $(IPNAT_OBJS) $(LDLIBS) 1717c478bd9Sstevel@tonic-gate $(POST_PROCESS) 1727c478bd9Sstevel@tonic-gate 173ab25eeb5Syz155240ipnat_y.o: ../ipnat_y.c $(COMMONIPF)/netinet/ip_nat.h \ 1747c478bd9Sstevel@tonic-gate ../ipnat_y.h ../ipnat_l.h 1757c478bd9Sstevel@tonic-gate 1767c478bd9Sstevel@tonic-gate../ipnat_y.c ../ipnat_y.h: ../ipnat_y.y 1777c478bd9Sstevel@tonic-gate $(YACC) -d -b ipnat ../ipnat_y.y 1787c478bd9Sstevel@tonic-gate sed -e 's/yy/ipnat_yy/g' \ 1797c478bd9Sstevel@tonic-gate -e 's/extern [a-z]* .*();//' \ 1807c478bd9Sstevel@tonic-gate -e 's/^\(static [a-z]* .*\)();/\1(void);/' \ 1817c478bd9Sstevel@tonic-gate ipnat.tab.c > ../ipnat_y.c 1827c478bd9Sstevel@tonic-gate sed -e 's/yy/ipnat_yy/g' -e 's/y.tab.h/ipnat_y.h/' \ 1837c478bd9Sstevel@tonic-gate ipnat.tab.h > ../ipnat_y.h 1847c478bd9Sstevel@tonic-gate 185ab25eeb5Syz155240ipnat_l.o: ../ipnat_l.c $(COMMONIPF)/netinet/ip_nat.h ../ipnat_l.h 1867c478bd9Sstevel@tonic-gate $(COMPILE.c) ../ipnat_l.c -o $@ 1877c478bd9Sstevel@tonic-gate 188ab25eeb5Syz155240../ipnat_l.c: ../lexer.c $(COMMONIPF)/netinet/ip_nat.h 1897c478bd9Sstevel@tonic-gate sed -e 's/yy/ipnat_yy/g' -e 's/y.tab.h/ipnat_y.h/' \ 1907c478bd9Sstevel@tonic-gate -e 's/lexer.h/ipnat_l.h/' ../lexer.c > $@ 1917c478bd9Sstevel@tonic-gate 1927c478bd9Sstevel@tonic-gate../ipnat_l.h: ../lexer.h 1937c478bd9Sstevel@tonic-gate sed -e 's/yy/ipnat_yy/g' ../lexer.h > $@ 1947c478bd9Sstevel@tonic-gate 19524da5b34Srieippool: $(IPPOOL_OBJS) $(LIBIPF) $(MAPFILE.NGB) 1967c478bd9Sstevel@tonic-gate $(LINK.c) -o ippool $(IPPOOL_OBJS) $(LDLIBS) 1977c478bd9Sstevel@tonic-gate $(POST_PROCESS) 1987c478bd9Sstevel@tonic-gate 199ab25eeb5Syz155240ippool_y.o: ../ippool_y.c $(COMMONIPF)/netinet/ip_pool.h \ 2007c478bd9Sstevel@tonic-gate ../ippool_y.h ../ippool_l.h 2017c478bd9Sstevel@tonic-gate 2027c478bd9Sstevel@tonic-gate../ippool_y.c ../ippool_y.h: ../ippool_y.y 2037c478bd9Sstevel@tonic-gate $(YACC) -d -b ippool ../ippool_y.y 2047c478bd9Sstevel@tonic-gate sed -e 's/yy/ippool_yy/g' \ 2057c478bd9Sstevel@tonic-gate -e 's/extern [a-z]* .*();//' \ 2067c478bd9Sstevel@tonic-gate -e 's/^\(static [a-z]* .*\)();/\1(void);/' \ 2077c478bd9Sstevel@tonic-gate ippool.tab.c > ../ippool_y.c 2087c478bd9Sstevel@tonic-gate sed -e 's/yy/ippool_yy/g' -e 's/y.tab.h/ippool_y.h/' \ 2097c478bd9Sstevel@tonic-gate ippool.tab.h > ../ippool_y.h 2107c478bd9Sstevel@tonic-gate 211ab25eeb5Syz155240ippool_l.o: ../ippool_l.c $(COMMONIPF)/netinet/ip_pool.h ../ippool_l.h 2127c478bd9Sstevel@tonic-gate $(COMPILE.c) ../ippool_l.c -o $@ 2137c478bd9Sstevel@tonic-gate 214ab25eeb5Syz155240../ippool_l.c: ../lexer.c $(COMMONIPF)/netinet/ip_pool.h 2157c478bd9Sstevel@tonic-gate sed -e 's/yy/ippool_yy/g' -e 's/y.tab.h/ippool_y.h/' \ 2167c478bd9Sstevel@tonic-gate -e 's/lexer.h/ippool_l.h/' ../lexer.c > $@ 2177c478bd9Sstevel@tonic-gate 2187c478bd9Sstevel@tonic-gate../ippool_l.h: ../lexer.h 2197c478bd9Sstevel@tonic-gate sed -e 's/yy/ippool_yy/g' ../lexer.h > $@ 2207c478bd9Sstevel@tonic-gate 22124da5b34Srieipftest: $(IPFTEST_OBJS) $(LIBIPF) $(MAPFILE.NGB) 22224da5b34Srie $(LINK.c) $(ZIGNORE) -o ipftest $(IPFTEST_OBJS) $(LDLIBS) 2237c478bd9Sstevel@tonic-gate $(POST_PROCESS) 2247c478bd9Sstevel@tonic-gate 2257c478bd9Sstevel@tonic-gateclean: 2267c478bd9Sstevel@tonic-gate -$(RM) $(CLEANFILES) 2277c478bd9Sstevel@tonic-gate 2287c478bd9Sstevel@tonic-gatelint: lint_SRCS 2297c478bd9Sstevel@tonic-gate 230ab25eeb5Syz155240%.o: $(SRC)/uts/common/inet/ipf/%.c 2317c478bd9Sstevel@tonic-gate $(COMPILE.c) $< 2327c478bd9Sstevel@tonic-gate 2337c478bd9Sstevel@tonic-gate%.o: ../%.c 2347c478bd9Sstevel@tonic-gate $(COMPILE.c) $< 2357c478bd9Sstevel@tonic-gate 236c793af95Ssangeeta%.o: $(SRC)/common/net/patricia/%.c 237c793af95Ssangeeta $(COMPILE.c) $< 238c793af95Ssangeeta 2397c478bd9Sstevel@tonic-gateinclude ../../../Makefile.targ 2407c478bd9Sstevel@tonic-gate 2417c478bd9Sstevel@tonic-gateFRC: 242