aboutsummaryrefslogblamecommitdiffstats
path: root/glougloud/Makefile
blob: 5308f40073e44b8adbeabe7c8099978eb17ae6cd (plain) (tree)
1
2
3
4
5



                          
                 








                                           
                                               

                                              

                                                                                       

                          
                                                                                 



                                  






                                         
PROG = glougloud
OBJS = glougloud.o
CFLAGS+=-Wall -g
LDFLAGS=-levent -lglouglou
USER = _glougloud

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

all:
	make $(OBJS)
	$(CC) $(OBJS) -o $(PROG) $(LDFLAGS)

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

clean:
	rm -f $(PROG) $(OBJS) *~