# pptpd Makefile
-include $(CONFIG_CONFIG)

PACKAGE = pptpd
PPPDIR = /etc/ppp

PLUGINS = pptpd-logwtmp.so
PPPD_PLUGINS = pptp.so

LDLIBS += -lutil

EXEC1 = pptpd
OBJS1 = pptpd.o configfile.o pptpmanager.o inststr.o compat.o getopt.o getopt1.o

EXEC2 = pptpctrl
OBJS2 = pptpctrl.o ctrlpacket.o inststr.o compat.o pptpgre.o ppphdlc.o pqueue.o

EXEC3 = bcrelay
OBJS3 = bcrelay.o


all:		$(EXEC1) $(EXEC2) $(EXEC3)


bcrelay.o: bcrelay.c defaults.h our_syslog.h our_getopt.h

compat.o: compat.c compat.h our_syslog.h inststr.h

configfile.o: configfile.c defaults.h configfile.h \
  our_syslog.h

ctrlpacket.o: ctrlpacket.c our_syslog.h pptpdefs.h \
  pptpctrl.h ctrlpacket.h compat.h

getopt.o: getopt.c our_getopt.h

getopt1.o: getopt1.c our_getopt.h

inststr.o: inststr.c inststr.h compat.h

ppphdlc.o: ppphdlc.c ppphdlc.h

pptpctrl.o: pptpctrl.c our_syslog.h compat.h pptpctrl.h \
  pptpgre.h pptpdefs.h ctrlpacket.h defaults.h pqueue.h

pptpd.o: pptpd.c our_syslog.h our_getopt.h configfile.h \
  defaults.h compat.h pptpmanager.h

pptpgre.o: pptpgre.c our_syslog.h ppphdlc.h pptpgre.h \
  pptpdefs.h pptpctrl.h defaults.h pqueue.h compat.h

pptpmanager.o: pptpmanager.c our_syslog.h configfile.h \
  defaults.h pptpctrl.h pptpdefs.h pptpmanager.h compat.h

pqueue.o: pqueue.c pqueue.h

$(EXEC1):	$(OBJS1)
		$(CC) $(LDFLAGS) -o $@ $(OBJS1) $(LDLIBS)

$(EXEC2):	$(OBJS2)
		$(CC) $(LDFLAGS) -o $@ $(OBJS2) $(LDLIBS)

$(EXEC3):	$(OBJS3)
		$(CC) $(LDFLAGS) -o $@ $(OBJS3) $(LDLIBS)

clean:
		rm -f $(EXEC1) $(EXEC2) $(EXEC3) *.elf *.o
		rm -f plugins/*.o plugins/*.so plugins/*.a

