2009-07-06 22:05:24 +03:00
|
|
|
include ../Makefile.inc
|
|
|
|
|
|
|
|
CPPFLAGS += -I../kernel
|
2009-03-26 22:56:47 +02:00
|
|
|
LDFLAGS =
|
|
|
|
|
2009-07-06 22:05:24 +03:00
|
|
|
ifneq ($(HOST_OS),Linux)
|
|
|
|
USE_LIBNL_MICRO=1
|
|
|
|
else
|
|
|
|
USE_LIBNL_MICRO=
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(USE_LIBNL_MICRO),1)
|
|
|
|
LIBNL_PREFIX = /usr/local
|
|
|
|
LIBNL = $(LIBNL_PREFIX)/lib/libnl-micro.a
|
|
|
|
CPPFLAGS += -I$(LIBNL_PREFIX)/include/libnl-micro
|
|
|
|
EXTRA_CFLAGS += -DNO_LOCAL_ACCESS
|
|
|
|
else
|
2009-03-26 22:56:47 +02:00
|
|
|
LIBNL = -lnl
|
2009-07-06 22:05:24 +03:00
|
|
|
endif
|
|
|
|
|
2009-03-26 22:56:47 +02:00
|
|
|
LIBM = -lm
|
|
|
|
LIBS = $(LIBNL) $(LIBM)
|
|
|
|
|
2009-07-06 22:05:24 +03:00
|
|
|
all: libwprobe.a wprobe-util
|
2009-03-26 22:56:47 +02:00
|
|
|
|
2009-07-06 22:05:24 +03:00
|
|
|
libwprobe.a: wprobe-lib.o
|
2009-03-26 22:56:47 +02:00
|
|
|
rm -f $@
|
|
|
|
$(AR) rcu $@ $^
|
|
|
|
$(RANLIB) $@
|
|
|
|
|
|
|
|
%.o: %.c
|
2009-07-06 22:05:24 +03:00
|
|
|
$(CC) $(WFLAGS) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) $<
|
2009-03-26 22:56:47 +02:00
|
|
|
|
2009-07-06 22:05:24 +03:00
|
|
|
wprobe-util: wprobe-util.o wprobe-lib.o
|
2009-03-26 22:56:47 +02:00
|
|
|
$(CC) -o $@ $^ $(LDFLAGS) $(LIBS)
|
2009-07-06 22:05:24 +03:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.o *.a wprobe-util
|