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 71 72 73 74 75 76 77 78 79 80 81 82
|
# $Id: Makefile 229 2008-03-22 13:32:56Z hgndgtl $
ifeq ($(shell test \! -f Make.Rules || echo yes),yes)
include Make.Rules
endif
TARGET = netsend
OBJECTS = analyze.o error.o file.o \
getopt.o main.o net.o \
proto_tipc.o proto_udp_recv.o \
receive.o trans_common.o \
ns_hdr.o xfuncs.o proto_tcp_trans.o \
proto_udp_trans.o proto_udplite_trans.o \
proto_udplite_recv.o proto_dccp_trans.o \
proto_sctp_trans.o proto_tipc_trans.o
POD = netsend.pod
MAN = netsend.1
LIBS = -lm
# Inline workaround:
# max-inline-insns-single specified the maximum size
# of a function (counted in internal gcc instructions).
# Default: 300
CFLAGS += --param max-inline-insns-single=400
# XXX: add path configure
DESTDIR=/usr
BINDIR=/bin
all: config.h $(TARGET)
config.h: Make.Rules
Make.Rules: configure
@if [ ! -f Make.Rules ] ; then \
echo "No Make.Rules file present" ; \
echo "Hint: call ./configure script" ; \
echo "./configure --help for more information" ; \
exit 1 ; fi
config.h:
@bash configure
$(TARGET): $(OBJECTS)
$(CC) $(CFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
%.o: %.c analyze.h error.h global.h xfuncs.h Makefile
$(CC) $(CFLAGS) -c $< -o $@
install: all
install $(TARGET) $(DESTDIR)$(BINDIR)
uninstall:
rm $(DESTDIR)$(BINDIR)/$(TARGET)
clean :
@rm -rf $(TARGET) $(OBJECTS) core *~
distclean: clean
@rm -f config.h Make.Rules $(MAN)
man: $(POD)
pod2man -d $(TARGET) -c $(TARGET) $(POD) > $(MAN)
test: unit_test.sh $(TARGET)
@./unit_test.sh
DISTNAME=$(TARGET)
release:
@if [ ! -f Make.Rules ]; then echo $(MAKE) Make.Rules first ;exit 1 ;fi
@if [ ! -L ../$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL) ]; then \
echo generating ../$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL) link ; \
ln -sf $(DISTNAME) ../$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL) ; \
echo to ../$(DISTNAME) . ; fi
@diff ../$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL)/Make.Rules Make.Rules
$(MAKE) distclean
cd .. ; tar zvfc $(DISTNAME)-$(MAJOR_REL).$(MINOR_REL).tar.gz \
--exclude .svn --exclude '.#*' \
$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL)/*
|