aboutsummaryrefslogtreecommitdiffstats
path: root/gg_trackproc/Makefile
diff options
context:
space:
mode:
authorLaurent Ghigonis <laurent@p1sec.com>2012-12-02 22:12:54 +0100
committerLaurent Ghigonis <laurent@p1sec.com>2012-12-02 22:12:54 +0100
commitaaf5558b4060c1c94f968b7b7742a1df2ac6eed1 (patch)
treeacf654f060a3d994e79a65fd622d57e41e285d36 /gg_trackproc/Makefile
parentdroppriv() and chroot in /proc (diff)
downloadglouglou-aaf5558b4060c1c94f968b7b7742a1df2ac6eed1.tar.xz
glouglou-aaf5558b4060c1c94f968b7b7742a1df2ac6eed1.zip
add "make install" and make clean" targets.
make install also adds _gg_sniff group and user.
Diffstat (limited to 'gg_trackproc/Makefile')
-rw-r--r--gg_trackproc/Makefile25
1 files changed, 25 insertions, 0 deletions
diff --git a/gg_trackproc/Makefile b/gg_trackproc/Makefile
index 00187e4..fb3b094 100644
--- a/gg_trackproc/Makefile
+++ b/gg_trackproc/Makefile
@@ -1,4 +1,29 @@
TARGET = gg_trackproc
+USER = _gg_sniff
+
+PREFIX=/usr/local
+BINDIR=$(PREFIX)/bin
all:
$(CC) -O2 -lglouglou -levent -Wall -o $(TARGET) $(TARGET).c
+
+install: $(TARGET)
+ @echo "creating group and user $(USER)"
+ @uname -a |grep -i linux >/dev/null ;\
+ if [ $$? -eq 0 ]; then \
+ cmdg="groupadd -r $(USER)" ;\
+ cmdu="useradd -r -g $(USER) -d /var/empty/ -s /sbin/nologin $(USER)" ;\
+ else \
+ cmdg="" ;\
+ cmdu="useradd -g =uid -d /var/empty/ -s /sbin/nologin $(USER)" ;\
+ fi ;\
+ echo $$cmdg; $$($$cmdg) ;\
+ echo $$cmdu; $$($$cmdu) ;\
+ echo done
+ @echo "installation of $(TARGET)"
+ mkdir -p $(BINDIR)
+ install -m 0755 $(TARGET) $(BINDIR)
+
+clean:
+ rm -f $(TARGET) $(OBJS) *~
+