36 lines
993 B
Makefile
36 lines
993 B
Makefile
#! /usr/bin/make -f
|
|
|
|
DEFAULTS = Makefile.config
|
|
|
|
include $(DEFAULTS)
|
|
|
|
all:sys_nicmonitor libnic_shm.so test
|
|
|
|
#CFLAGS += -D TESTINTERVAL -Wall -Wformat=2 -Wno-format-extra-args -Wformat-security -Wformat-nonliteral -O0 -g
|
|
CFLAGS += -Wall -Wformat=2 -Wno-format-extra-args -Wformat-security -Wformat-nonliteral -O0 -g
|
|
|
|
sys_nicmonitor:mnic.o read_netcard.o send_alarm.o
|
|
$(CC) -lman -ldotconf -lpthread -o $@ $^
|
|
libnic_shm.so:nicinfo_shm.o
|
|
$(CC) -fpic -shared -o $@ $^
|
|
nicinfo_shm.o:nicinfo_shm.c
|
|
$(CC) $(CFLAGS) -fPIC -c $^
|
|
test:test.c
|
|
gcc -o test test.c -lnic_shm -L=./ -lpthread
|
|
runtest:
|
|
LD_LIBRARY_PATH=./ ./test bond0 5000 &
|
|
clean:
|
|
$(RM) *.o
|
|
$(RM) libnic_shm.so sys_nicmonitor test
|
|
install:
|
|
$(MKDIR) -p $(LIBDIR)
|
|
$(MKDIR) -p $(BINDIR)
|
|
$(MKDIR) -p $(INCDIR)
|
|
$(CP) libnic_shm.so $(LIBDIR)
|
|
$(CP) sys_nicmonitor $(BINDIR)
|
|
$(CP) nicinfo_shm.h $(INCDIR)
|
|
uninstall:
|
|
$(RM) -f $(LIBDIR)/libnic_shm.so
|
|
$(RM) -f $(BINDIR)/sys_nicmonitor
|
|
$(RM) -f $(INCDIR)/nicinfo_shm.h
|