Commit b1a44c21 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Linux changes to the makefile.

parent e09137dc
......@@ -8,6 +8,7 @@ SRCDIR = @srcdir@
TESTBED_SRCDIR = @top_srcdir@
OBJDIR = ../..
SUBDIR = tools/pcapper
SYSTEM := $(shell uname -s)
include $(OBJDIR)/Makeconf
......@@ -36,11 +37,11 @@ LDFLAGS = -static
CFLAGS_FBSD = $(CFLAGS) $(TBCFLAGS)
CFLAGS_FBSD_NE = $(CFLAGS)
CFLAGS_LINUX = $(CFLAGS) -I/usr/include/pcap
CFLAGS_LINUX = $(CFLAGS) -I/usr/include/pcap $(TBCFLAGS)
LIBS_FBSD = $(PTHREADLIBS) $(TBLIBS) $(PCAPLIBS)
LIBS_FBSD_NE = $(PTHREADLIBS) $(PCAPLIBS)
LIBS_LINUX = -L/usr/lib -lpthread -lpcap
LIBS_LINUX = -L/usr/lib -lpthread -lpcap $(TBLIBS)
# virtual (encapsulated) ethernet
#CFLAGS_FBSD += -DVETH
......@@ -48,10 +49,18 @@ LIBS_LINUX = -L/usr/lib -lpthread -lpcap
clean:
-rm -f pcapper*.o pcapper pcapper.noevents pcapper.linux *.debug
ifeq ($(SYSTEM),Linux)
#
# Note: Building on Linux with the event system is mighty tricky
#
pcapper: pcapper.c GNUmakefile
$(CC) $(CFLAGS_LINUX) $(CPPFLAGS_LINUX) $< -o pcapper $(LIBS_LINUX)
else
pcapper: GNUmakefile pcapper.o
$(CC) $(LDFLAGS) $(CFLAGS_FBSD) pcapper.o $(LIBS_FBSD) -o pcapper
cp pcapper pcapper.debug
strip pcapper
endif
pcapper.o: pcapper.c
$(CC) -c -o pcapper.o $(CFLAGS_FBSD) $<
......@@ -65,13 +74,6 @@ pcapper.noevents: GNUmakefile pcapper-noevents.o
pcapper-noevents.o: pcapper.c
$(CC) -c -o pcapper-noevents.o $(CFLAGS_FBSD_NE) $<
#
# Note: Building on Linux with the event system is mighty tricky
#
pcapper.linux: pcapper.c GNUmakefile
$(CC) $(CFLAGS_LINUX) $(CPPFLAGS_LINUX) $(LIBS_LINUX) pcapper.c \
-o pcapper.linux
client: pcapper
client-install: client
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment