DEBUG_FLAGS=-Wall -g CFLAGS += `pkg-config --cflags glib-2.0` $(DEBUG_FLAGS) -D_FILE_OFFSET_BITS=64 -I /usr/local/include LDFLAGS += `pkg-config --libs glib-2.0` -L/usr/local/lib -lpopt VERSION=$(shell awk '/Version:/ { print $$2 }' netdump.spec) # Used to append this to CVSTAG: _$(subst .,-,$(RELEASE)), but now that # this is just an external source, it has no release. Just name-version. CVSTAG = netdump-$(subst .,_,$(VERSION)) SOURCES=netconsole.h netdumpclient.c netdumpclient.h netdumpelf.h server.c server.h configuration.c configuration.h EXTRA_DIST=README Makefile ChangeLog COPYING netdump.spec crash.c EXPORTDIR=$(shell mktemp -d /tmp/netdumpXXXXXX) all: netdump-server server.o: $(SOURCES) netdumpclient.o: $(SOURCES) netdump-server: server.o netdumpclient.o configuration.o gcc -o netdump-server server.o netdumpclient.o configuration.o $(LDFLAGS) install: netdump-server mkdir -p $(DESTDIR)/var/crash mkdir -p $(DESTDIR)/var/crash/scripts mkdir -m 700 -p $(DESTDIR)/var/crash/magic mkdir -m 700 -p $(DESTDIR)/var/crash/.ssh touch $(DESTDIR)/var/crash/.ssh/authorized_keys2 chmod u=rw,go= $(DESTDIR)/var/crash/.ssh/authorized_keys2 mkdir -p $(DESTDIR)/usr/sbin mkdir -p $(DESTDIR)/etc/sysconfig mkdir -p $(DESTDIR)/etc/rc.d/init.d cp netdump-server $(DESTDIR)/usr/sbin cp netdump.sysconfig $(DESTDIR)/etc/sysconfig/netdump cp netdump.init $(DESTDIR)/etc/rc.d/init.d/netdump chmod a+x $(DESTDIR)/etc/rc.d/init.d/netdump cp netdump-server.init $(DESTDIR)/etc/rc.d/init.d/netdump-server chmod a+x $(DESTDIR)/etc/rc.d/init.d/netdump-server mkdir -p $(DESTDIR)/usr/share/man/man8 cp netdump-server.8 $(DESTDIR)/usr/share/man/man8 cp netdump.8 $(DESTDIR)/usr/share/man/man8 tag-archive: @cvs -Q tag -F $(CVSTAG) create-archive: tag-archive @if [ -z "$(CVSROOT)" ]; then \ echo "No CVSROOT defined"; \ exit 1; \ fi @if [ -e /tmp/netdump ]; then \ echo -n "Warning: /tmp/netdump exists. Directory will be "; \ echo "removed in 5 seconds. Press Ctrl-C to abort"; \ sleep 5; \ fi @rm -f /tmp/netdump @cd /tmp ; cvs -Q -d $(CVSROOT) export -r$(CVSTAG) netdump || \ ( echo "Export failed." ; exit 1 ) @mv /tmp/netdump /tmp/netdump-$(VERSION) @cd /tmp; tar czSpf netdump-$(VERSION).tar.gz netdump-$(VERSION) @rm -rf /tmp/netdump-$(VERSION) @cp /tmp/netdump-$(VERSION).tar.gz . @rm -f /tmp/netdump-$(VERSION).tar.gz @echo " " @echo "The final archive is netdump-$(VERSION).tar.gz" archive: clean tag-archive create-archive clean: rm -f *.o netdump-server dist: archive