CC        ?= gcc
LD        = ${CC}
CFLAGS    ?= -g -Wall
LDFLAGS   ?= -g
DBUS_LIBS ?= -ldbus-1

all:	test_dhcp_options test_dhcdbd_state test_subscriber test_subscriber_dbus test_prospective_subscriber

.c.o:
	$(CC) $(CFLAGS) -I.. -c $<

.SUFFIXES: .c .o

test_dhcp_options: t.o
	$(LD) $(LDFLAGS) -o ../test_dhcp_options t.o ../dhcp_options.o

test_dhcdbd_state: test_binary.o
	$(LD) $(LDFLAGS) -o ../test_dhcdbd_state test_binary.o ../dbus_service.o $(DBUS_LIBS)

test_subscriber: test_subscriber.o
	$(LD) $(LDFLAGS) -o ../test_subscriber test_subscriber.o ../dbus_service.o $(DBUS_LIBS)

test_subscriber_dbus: test_subscriber_dbus.o
	$(LD) $(LDFLAGS) -o ../test_subscriber_dbus test_subscriber_dbus.o ../dbus_service.o $(DBUS_LIBS)

test_prospective_subscriber: test_prospective_subscriber.o
	$(LD) $(LDFLAGS) -o ../test_prospective_subscriber test_prospective_subscriber.o ../dbus_service.o $(DBUS_LIBS)


clean:
	/bin/rm -f *.o *~ ../test_dhcdbd_state ../test_dhcp_options ../test_subscriber ../test_subscriber_dbus ../test_prospective_subscriber


