
CC = gcc
STD_HEADERS = stdhead.h head.h struct.h options_type.h message_type.h states.h timer_val.h constants.h macros.h status_codes.h
OBJECT_FILES = client.o solicit.o clilib.o parse.o request.o decline.o renew.o rebind.o release.o
HEADER_FILES = solicit.h clilib.h parse.h request.h decline.h renew.h rebind.h release.h
CFLAGS = -g3

dhcpv6_client : dhcpv6_client.c cli
	$(CC) $(CFLAGS) $(LDFLAGS) dhcpv6_client.c -o dhcpv6_client

cli : $(OBJECT_FILES)
	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJECT_FILES) -o cli

client.o : client.c $(STD_HEADERS) $(HEADER_FILES)
	$(CC) $(CFLAGS) -c client.c -o client.o

release.o : release.c release.h clilib.h
	$(CC) $(CFLAGS) -c release.c -o release.o

rebind.o : rebind.c rebind.h clilib.h
	$(CC)  $(CFLAGS) -c rebind.c -o rebind.o

renew.o : renew.c renew.h clilib.h
	$(CC) $(CFLAGS) -c renew.c -o renew.o

request.o : request.c request.h clilib.h
	$(CC) $(CFLAGS) -c request.c -o request.o

decline.o : decline.c decline.h clilib.h parse.h solicit.h
	$(CC) $(CFLAGS) -c decline.c -o decline.o

solicit.o : solicit.c solicit.h clilib.h parse.h
	$(CC) $(CFLAGS) -c solicit.c -o solicit.o

clilib.o : clilib.c clilib.h parse.h
	$(CC) $(CFLAGS) -c clilib.c -o clilib.o

parse.o : parse.c parse.h clilib.h
	$(CC) $(CFLAGS) -c parse.c -o parse.o

clean :
	rm -f *.o cli dhcpv6_client
