fixed lib make install

This commit is contained in:
Mohamed Boussaffa
2016-03-08 19:51:19 +08:00
parent 9e9b77f144
commit b566871d6b
3 changed files with 22 additions and 9 deletions

View File

@@ -1,7 +1,8 @@
prefix := /usr/local
libdir := $(prefix)/lib
incdir := $(prefix)/include
all: libnethogs
all: libnethogs.so
LDFLAGS:= -shared
CXXINCLUDES :=
@@ -30,18 +31,24 @@ OBJS=$(addprefix $(ODIR)/,$(OBJ_NAMES))
.PHONY: uninstall
install: libnethogs
install: libnethogs.so
install -d -m 755 $(DESTDIR)$(libdir)
install -m 755 libnethogs $(DESTDIR)$(libdir)
install -m 755 libnethogs.so $(DESTDIR)$(libdir)
@echo
@echo "Installed libnethogs to $(DESTDIR)$(libdir)"
@echo "Installed libnethogs.so to $(DESTDIR)$(libdir)"
@echo
install -d -m 755 $(DESTDIR)$(incdir)
install -m 755 libnethogs.h $(DESTDIR)$(incdir)
@echo
@echo "Installed libnethogs.h to $(DESTDIR)$(incdir)"
@echo
uninstall:
rm $(DESTDIR)$(libdir)/libnethogs
rm $(DESTDIR)$(libdir)/libnethogs.so
rm $(DESTDIR)$(incdir)/libnethogs.h
libnethogs: $(OBJS)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(OBJS) -o libnethogs.so -lpcap
libnethogs.so: $(OBJS)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(OBJS) -o $@ -lpcap
#-lefence

View File

@@ -71,9 +71,7 @@ static void wait_for_next_trigger()
FD_SET(fd, &pc_loop_fd_set);
}
timeval timeout = {monitor_refresh_delay, 0};
std::cout << "--------------------------1\n";
select(nfds, &pc_loop_fd_set, 0, 0, &timeout);
std::cout << "--------------------------0\n\n";
}
else
{

View File

@@ -1,6 +1,10 @@
#ifndef LIBNETHOGS_H_
#define LIBNETHOGS_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stdbool.h>
@@ -42,4 +46,8 @@ NETHOGS_DSO_VISIBLE void nethogsmonitor_stop();
#undef NETHOGS_DSO_VISIBLE
#undef NETHOGS_DSO_HIDDEN
#ifdef __cplusplus
}
#endif
#endif // LIBNETHOGS_H_