#
# $Id: Makefile 3185 2009-07-03 21:32:41Z owes $
#

COMPILE=$(CC) $(CFLAGS) -D_GNU_SOURCE -I../installer/
OBJLIBS=setuid.o ../installer/helper.o

PROGS = iowrap
SUID_PROGS = accountingctrl setfwrules   \
	restartdhcp restartsquid restartssh ipcopreboot \
	ipcopbkcfg ipcoprscfg installpackage installfcdsl ipsecctrl \
	setaliases ipcopbackup restartshaping restartntpd \
	setdate rebuildhosts rebuildlangtexts conntrack_helper \
	restartsyslogd logwatch sysinfo openvpnctrl iptableswrapper

all : helper.o $(PROGS) $(SUID_PROGS)

install :
	install -m 755  $(PROGS) /usr/local/bin
	install -m 4750 -g nobody $(SUID_PROGS) /usr/local/bin

######

% : %.c setuid.o ../installer/helper.o
	$(COMPILE) $< $(OBJLIBS) -o $@

helper.o :
	$(MAKE) -C ../installer helper
setuid.o: setuid.c setuid.h
	$(COMPILE) $< -c -o $@

$(SUID_PROGS): setuid.o ../installer/helper.o

$(PROGS): setuid.o

ipcopbkcfg: ipcopbkcfg.c setuid.o
	$(COMPILE) -lcrypt ipcopbkcfg.c setuid.o -o $@
