aboutsummaryrefslogtreecommitdiffstats
path: root/glougloud/Makefile
blob: 6e66791634fb875fb0db4dea63cd34445d363d5f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
PROG = glougloud
OBJS = glougloud.o
CFLAGS+=-Wall -g
LDFLAGS=-levent -lglouglou

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

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

install: $(PROG)
	@echo "creating group and user _glougloud"
	@uname -a |grep -i linux >/dev/null ;\
	if [ $$? -eq 0 ]; then \
		cmdg="groupadd -r _glougloud" ;\
		cmdu="useradd -r -g _glougloud -d /var/empty/ -s /sbin/nologin _glougloud" ;\
	else \
		cmdg="" ;\
		cmdu="useradd -g =uid -d /var/empty/ -s /sbin/nologin _glougloud" ;\
	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) *~