1 |
745 |
simons |
#
|
2 |
|
|
# Makefile Main Makefile for the net-tools Package
|
3 |
|
|
#
|
4 |
|
|
# NET-TOOLS A collection of programs that form the base set of the
|
5 |
|
|
# NET-3 Networking Distribution for the LINUX operating
|
6 |
|
|
# system.
|
7 |
|
|
#
|
8 |
|
|
# Version: Makefile 1.45 (1996-06-29)
|
9 |
|
|
#
|
10 |
|
|
# Author: Bernd Eckenfels
|
11 |
|
|
# Copyright 1995-1996 Bernd Eckebnfels, Germany
|
12 |
|
|
#
|
13 |
|
|
# URLs: ftp://ftp.inka.de/pub/comp/Linux/networking/NetTools/
|
14 |
|
|
# ftp://ftp.linux.org.uk/pub/linux/Networking/PROGRAMS/NetTools/
|
15 |
|
|
# http://www.inka.de/sites/lina/linux/NetTools/index_en.html
|
16 |
|
|
#
|
17 |
|
|
# Based on: Fred N. van Kempen,
|
18 |
|
|
# Copyright 1988-1993 MicroWalt Corporation
|
19 |
|
|
#
|
20 |
|
|
# Modifications:
|
21 |
|
|
# Extensively modified from 01/21/94 onwards by
|
22 |
|
|
# Alan Cox
|
23 |
|
|
# Copyright 1993-1994 Swansea University Computer Society
|
24 |
|
|
#
|
25 |
|
|
# Be careful!
|
26 |
|
|
# This Makefile doesn't describe complete dependencies for all include files.
|
27 |
|
|
# If you change include files you might need to do make clean.
|
28 |
|
|
#
|
29 |
|
|
# {1.20} Bernd Eckenfels: Even more modifications for the new
|
30 |
|
|
# package layout
|
31 |
|
|
# {1.21} Bernd Eckenfels: Check if config.in is newer than
|
32 |
|
|
# config.status
|
33 |
|
|
# {1.22} Bernd Eckenfels: Include ypdomainname and nisdomainame
|
34 |
|
|
#
|
35 |
|
|
# 1.3.50-BETA6 private Release
|
36 |
|
|
#
|
37 |
|
|
#960125 {1.23} Bernd Eckenfels: Peter Tobias' rewrite for
|
38 |
|
|
# makefile-based installation
|
39 |
|
|
# 1.3.50-BETA6a private Release
|
40 |
|
|
#
|
41 |
|
|
#960201 {1.24} Bernd Eckenfels: net-features.h added
|
42 |
|
|
#
|
43 |
|
|
#960201 1.3.50-BETA6b private Release
|
44 |
|
|
#
|
45 |
|
|
#960203 1.3.50-BETA6c private Release
|
46 |
|
|
#
|
47 |
|
|
#960204 1.3.50-BETA6d private Release
|
48 |
|
|
#
|
49 |
|
|
#960204 {1.25} Bernd Eckenfels: DISTRIBUTION added
|
50 |
|
|
#
|
51 |
|
|
#960205 1.3.50-BETA6e private Release
|
52 |
|
|
#
|
53 |
|
|
#960206 {1.26} Bernd Eckenfels: afrt.o removed (cleaner solution)
|
54 |
|
|
#
|
55 |
|
|
#960215 1.3.50-BETA6f Release
|
56 |
|
|
#
|
57 |
|
|
#960216 {1.30} Bernd Eckenfels: net-lib support
|
58 |
|
|
#960322 {1.31} Bernd Eckenfels: moveable netlib, TOPDIR
|
59 |
|
|
#960424 {1.32} Bernd Eckenfels: included the URLs in the Comment
|
60 |
|
|
#
|
61 |
|
|
#960514 1.31-alpha release
|
62 |
|
|
#
|
63 |
|
|
#960518 {1.33} Bernd Eckenfels: -I/usr/src/linux/include comment added
|
64 |
|
|
#
|
65 |
|
|
# This program is free software; you can redistribute it
|
66 |
|
|
# and/or modify it under the terms of the GNU General
|
67 |
|
|
# Public License as published by the Free Software
|
68 |
|
|
# Foundation; either version 2 of the License, or (at
|
69 |
|
|
# your option) any later version.
|
70 |
|
|
#
|
71 |
|
|
|
72 |
|
|
# set the base of the Installation
|
73 |
|
|
# BASEDIR = /mnt
|
74 |
|
|
|
75 |
|
|
# path to the net-lib support library. Default: lib
|
76 |
|
|
NET_LIB_PATH = lib
|
77 |
|
|
NET_LIB_NAME = net-tools
|
78 |
|
|
|
79 |
|
|
PROGS := ifconfig hostname arp netstat route rarp slattach plipconfig
|
80 |
|
|
|
81 |
|
|
-include config.make
|
82 |
|
|
ifeq ($(HAVE_IP_TOOLS),1)
|
83 |
|
|
PROGS += iptunnel ipmaddr
|
84 |
|
|
endif
|
85 |
|
|
|
86 |
|
|
# Compiler and Linker Options
|
87 |
|
|
# You may need to uncomment and edit these if you are using libc5 and IPv6.
|
88 |
|
|
COPTS = -D_GNU_SOURCE -O2 -Wall -g # -I/usr/inet6/include
|
89 |
|
|
LOPTS =
|
90 |
|
|
RESLIB = # -L/usr/inet6/lib -linet6
|
91 |
|
|
|
92 |
|
|
ifeq ($(HAVE_AFDECnet),1)
|
93 |
|
|
DNLIB = -ldnet
|
94 |
|
|
endif
|
95 |
|
|
|
96 |
|
|
# -------- end of user definitions --------
|
97 |
|
|
|
98 |
|
|
MAINTAINER = Philip.Blundell@pobox.com
|
99 |
|
|
RELEASE = 1.52
|
100 |
|
|
|
101 |
|
|
.EXPORT_ALL_VARIABLES:
|
102 |
|
|
|
103 |
|
|
ifeq ("$(NET_LIB_PATH)","lib2")
|
104 |
|
|
TOPDIR = ..
|
105 |
|
|
else
|
106 |
|
|
TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
|
107 |
|
|
endif
|
108 |
|
|
|
109 |
|
|
NET-LIB = $(NET_LIB_PATH)/lib$(NET_LIB_NAME).a
|
110 |
|
|
|
111 |
|
|
CFLAGS = $(COPTS) -I. -idirafter ./include/ -I$(NET_LIB_PATH)
|
112 |
|
|
LDFLAGS = $(LOPTS) -L$(NET_LIB_PATH)
|
113 |
|
|
|
114 |
|
|
SUBDIRS = man/ $(NET_LIB_PATH)/
|
115 |
|
|
|
116 |
|
|
CC = gcc
|
117 |
|
|
LD = gcc
|
118 |
|
|
|
119 |
|
|
NLIB = -l$(NET_LIB_NAME)
|
120 |
|
|
|
121 |
|
|
MDEFINES = COPTS='$(COPTS)' LOPTS='$(LOPTS)' TOPDIR='$(TOPDIR)'
|
122 |
|
|
|
123 |
|
|
%.o: %.c config.h version.h intl.h net-features.h $<
|
124 |
|
|
$(CC) $(CFLAGS) -c $<
|
125 |
|
|
|
126 |
|
|
all: config.h version.h subdirs $(PROGS)
|
127 |
|
|
|
128 |
|
|
config: cleanconfig config.h
|
129 |
|
|
|
130 |
|
|
install: all savebin installbin installdata
|
131 |
|
|
|
132 |
|
|
update: all installbin installdata
|
133 |
|
|
|
134 |
|
|
mostlyclean:
|
135 |
|
|
rm -f *.o DEADJOE config.new *~ *.orig lib/*.o
|
136 |
|
|
|
137 |
|
|
clean: mostlyclean
|
138 |
|
|
rm -f $(PROGS)
|
139 |
|
|
@for i in $(SUBDIRS); do (cd $$i && make clean) ; done
|
140 |
|
|
@cd po && make clean
|
141 |
|
|
|
142 |
|
|
cleanconfig:
|
143 |
|
|
rm -f config.h
|
144 |
|
|
|
145 |
|
|
clobber: clean
|
146 |
|
|
rm -f $(PROGS) config.h version.h config.status
|
147 |
|
|
@for i in $(SUBDIRS); do (cd $$i && make clobber) ; done
|
148 |
|
|
|
149 |
|
|
|
150 |
|
|
dist: clobber
|
151 |
|
|
@echo Creating net-tools-$(RELEASE) in ..
|
152 |
|
|
@tar -cvz -f ../net-tools-$(RELEASE).tar.gz -C .. net-tools-${RELEASE}
|
153 |
|
|
|
154 |
|
|
|
155 |
|
|
config.h: config.in Makefile
|
156 |
|
|
@echo "Configuring the Linux net-tools (NET-3 Base Utilities)..." ; echo
|
157 |
|
|
@if [ config.status -nt config.in ]; \
|
158 |
|
|
then ./configure.sh
|
159 |
|
|
else ./configure.sh
|
160 |
|
|
fi
|
161 |
|
|
|
162 |
|
|
|
163 |
|
|
version.h: Makefile
|
164 |
|
|
@echo "#define RELEASE \"net-tools $(RELEASE)\"" >version.h
|
165 |
|
|
|
166 |
|
|
|
167 |
|
|
$(NET-LIB): config.h version.h intl.h libdir
|
168 |
|
|
|
169 |
|
|
i18n.h: i18ndir
|
170 |
|
|
|
171 |
|
|
libdir:
|
172 |
|
|
@$(MAKE) -C $(NET_LIB_PATH) $(MDEFINES)
|
173 |
|
|
|
174 |
|
|
i18ndir:
|
175 |
|
|
@$(MAKE) -C po
|
176 |
|
|
|
177 |
|
|
subdirs:
|
178 |
|
|
@for i in $(SUBDIRS); do $(MAKE) -C $$i $(MDEFINES) ; done
|
179 |
|
|
|
180 |
|
|
ifconfig: $(NET-LIB) ifconfig.o
|
181 |
|
|
$(CC) $(LDFLAGS) -o ifconfig ifconfig.o $(NLIB) $(RESLIB)
|
182 |
|
|
|
183 |
|
|
hostname: hostname.o
|
184 |
|
|
$(CC) $(LDFLAGS) -o hostname hostname.o $(DNLIB)
|
185 |
|
|
|
186 |
|
|
route: $(NET-LIB) route.o
|
187 |
|
|
$(CC) $(LDFLAGS) -o route route.o $(NLIB) $(RESLIB)
|
188 |
|
|
|
189 |
|
|
arp: $(NET-LIB) arp.o
|
190 |
|
|
$(CC) $(LDFLAGS) -o arp arp.o $(NLIB) $(RESLIB)
|
191 |
|
|
|
192 |
|
|
rarp: $(NET-LIB) rarp.o
|
193 |
|
|
$(CC) $(LDFLAGS) -o rarp rarp.o $(NLIB)
|
194 |
|
|
|
195 |
|
|
slattach: $(NET-LIB) slattach.o
|
196 |
|
|
$(CC) $(LDFLAGS) -o slattach slattach.o $(NLIB)
|
197 |
|
|
|
198 |
|
|
plipconfig: $(NET-LIB) plipconfig.o
|
199 |
|
|
$(CC) $(LDFLAGS) -o plipconfig plipconfig.o $(NLIB)
|
200 |
|
|
|
201 |
|
|
netstat: $(NET-LIB) netstat.o statistics.o
|
202 |
|
|
$(CC) $(LDFLAGS) -o netstat netstat.o statistics.o $(NLIB) $(RESLIB)
|
203 |
|
|
|
204 |
|
|
iptunnel: $(NET-LIB) iptunnel.o
|
205 |
|
|
$(CC) $(LDFLAGS) -o iptunnel iptunnel.o $(NLIB) $(RESLIB)
|
206 |
|
|
|
207 |
|
|
ipmaddr: $(NET-LIB) ipmaddr.o
|
208 |
|
|
$(CC) $(LDFLAGS) -o ipmaddr ipmaddr.o $(NLIB) $(RESLIB)
|
209 |
|
|
|
210 |
|
|
installbin:
|
211 |
|
|
install -m 0755 -d ${BASEDIR}/sbin
|
212 |
|
|
install -m 0755 -d ${BASEDIR}/bin
|
213 |
|
|
install -m 0755 arp ${BASEDIR}/sbin
|
214 |
|
|
install -m 0755 ifconfig ${BASEDIR}/sbin
|
215 |
|
|
install -m 0755 netstat ${BASEDIR}/bin
|
216 |
|
|
install -m 0755 rarp ${BASEDIR}/sbin
|
217 |
|
|
install -m 0755 route ${BASEDIR}/sbin
|
218 |
|
|
install -m 0755 hostname ${BASEDIR}/bin
|
219 |
|
|
install -m 0755 slattach $(BASEDIR)/sbin
|
220 |
|
|
install -m 0755 plipconfig $(BASEDIR)/sbin
|
221 |
|
|
ifeq ($(HAVE_IP_TOOLS),1)
|
222 |
|
|
install -m 0755 ipmaddr $(BASEDIR)/sbin
|
223 |
|
|
install -m 0755 iptunnel $(BASEDIR)/sbin
|
224 |
|
|
endif
|
225 |
|
|
ln -fs hostname $(BASEDIR)/bin/dnsdomainname
|
226 |
|
|
ln -fs hostname $(BASEDIR)/bin/ypdomainname
|
227 |
|
|
ln -fs hostname $(BASEDIR)/bin/nisdomainname
|
228 |
|
|
ln -fs hostname $(BASEDIR)/bin/domainname
|
229 |
|
|
ifeq ($(HAVE_AFDECnet),1)
|
230 |
|
|
ln -fs hostname $(BASEDIR)/bin/nodename
|
231 |
|
|
endif
|
232 |
|
|
|
233 |
|
|
savebin:
|
234 |
|
|
@for i in ${BASEDIR}/sbin/arp ${BASEDIR}/sbin/ifconfig \
|
235 |
|
|
${BASEDIR}/bin/netstat \
|
236 |
|
|
${BASEDIR}/sbin/rarp ${BASEDIR}/sbin/route \
|
237 |
|
|
${BASEDIR}/bin/hostname ${BASEDIR}/bin/ypdomainname \
|
238 |
|
|
${BASEDIR}/bin/dnsdomainname ${BASEDIR}/bin/nisdomainname \
|
239 |
|
|
${BASEDIR}/bin/domainname ; do \
|
240 |
|
|
[ -f $$i ] && cp -f $$i $$i.old ; done ; echo Saved.
|
241 |
|
|
|
242 |
|
|
installdata:
|
243 |
|
|
$(MAKE) -C man install
|
244 |
|
|
$(MAKE) -C po install
|
245 |
|
|
|
246 |
|
|
# End of Makefile.
|