1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
# Makefile for pnscan
TAR=tar
GZIP=gzip
MAKE=make
## Solaris 8 with Gcc 3.0
GSO_CC=gcc -Wall -g -O -pthreads
GSO_LIBS= -lnsl -lsocket
## Solaris 8 with Forte C 6.2
SOL_CC=cc -mt -O
SOL_LIBS= -lpthread -lnsl -lsocket
## Linux 2.4 with Gcc 2.96
LNX_CC=gcc -g -O
LNX_LIBS=-lpthread -lnsl
default:
@echo 'Use "make SYSTEM" where SYSTEM may be:'
@echo ' lnx (Linux with GCC)'
@echo ' gso (Solaris with GCC v3)'
@echo ' sol (Solaris with Forte C)'
@exit 1
lnx linux:
@$(MAKE) all CC="$(LNX_CC)" LIBS="$(LNX_LIBS)"
gso:
@$(MAKE) all CC="$(GSO_CC)" LIBS="$(GSO_LIBS)"
sol solaris:
@$(MAKE) all CC="$(SOL_CC)" LIBS="$(SOL_LIBS)"
all: pnscan
man: pnscan.1 ipsort.1
pnscan.1:
docbook-to-man pnscan.sgml > pnscan.1
ipsort.1:
docbook-to-man ipsort.sgml > ipsort.1
pnscan: pnscan.o bm.o version.o
$(CC) -o pnscan pnscan.o bm.o version.o $(LIBS)
version:
(PACKNAME=`basename \`pwd\`` ; echo 'char version[] = "'`echo $$PACKNAME | cut -d- -f2`'";' >version.c)
clean distclean:
-rm -f *.1 *.o *~ pnscan core \#*
-rm -Rf tmp
dist: distclean version
(PACKNAME=`basename \`pwd\`` ; cd .. ; $(TAR) cf - $$PACKNAME | $(GZIP) -9 >$$PACKNAME.tar.gz)
install: all
cp pnscan /usr/local/bin
cp ipsort /usr/local/bin
install-distribution: all man
cp pnscan $(DESTDIR)/usr/bin
cp ipsort $(DESTDIR)/usr/bin
mkdir tmp
cp *.1 tmp
gzip -9 tmp/*.1
mv tmp/*.1* $(DESTDIR)/usr/share/man/man1
rmdir tmp
|