#! /usr/bin/make -f

DEFAULTS = Makefile.config

include $(DEFAULTS)

all:sys_nicmonitor libnic_shm.so  

CFLAGS +=  -Wall -Wformat=2 -Wno-format-extra-args -Wformat-security -Wformat-nonliteral #-g  

sys_nicmonitor:mnic.o read_netcard.o send_alarm.o
	$(CC)  -lman -ldotconf -lpthread -o $@ $^
libnic_shm.so:nicinfo_shm.c
	$(CC) -fpic -shared -o $@ $^
clean:
	$(RM) *.o
	$(RM) libnic_shm.so sys_nicmonitor
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
