CC = gcc
STD_HEADERS = stdhead.h head.h struct.h options_type.h message_type.h macros.h status_codes.h constants.h
OBJECT_FILES = server.o lib.o advertise.o parse.o leases.o reply.o
CFLAGS = -g3

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

lib.o: lib.c lib.h $(STD_HEADERS)
	$(CC) $(CFLAGS) -c lib.c -o lib.o

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

leases.o: leases.c leases.h $(STD_HEADERS)
	$(CC) $(CFLAGS) -c leases.c -o leases.o

advertise.o: advertise.c advertise.h $(STD_HEADERS)
	$(CC) $(CFLAGS) -c advertise.c -o advertise.o

reply.o: reply.c reply.h $(STD_HEADERS)
	$(CC) $(CFLAGS) -c reply.c -o reply.o

server.o: server.c lib.h advertise.h reply.h leases.h parse.h $(STD_HEADERS)
	$(CC) $(CFLAGS) -c server.c -o server.o

clean: 
	rm -f *.o serv
