aboutsummaryrefslogblamecommitdiffstats
path: root/gg_sniff/Makefile
blob: 297e8a5f2eaee036446c03c788760ebf57007430 (plain) (tree)
1
2
3
4
5
6
7
8
9
                   
                                    
 
                 
                
                           
                          
 
                   

                    

                                                          
 
        











                                                                                       

                                         


                                           
                                  
 
CFLAGS += -Wall -O2
LDFLAGS += -levent -lglouglou -lpcap

BINARY = gg_sniff
USER = _gg_sniff
SOURCES = gg_sniff.c pcap.c
OBJECTS = $(SOURCES:.c=.o)

PREFIX = /usr/local
BINDIR=$(PREFIX)/bin

$(BINARY): $(OBJECTS)
	$(CC) $(CFLAGS) $(LDFLAGS) -o $(BINARY) $(OBJECTS)

install:
	@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 $(BINARY)"
	mkdir -p $(BINDIR)
	install -m 0755 $(BINARY) $(BINDIR)

clean:
	rm -f $(BINARY) $(OBJECTS)