##############################################################################
# Options for compiling the driver
CC     = cc
CFLAGS = -O2

##############################################################################
# Options to compile into the driver
PCLU_CLUHOME         = $(CLUHOME)
PCLU_CC              = $(CC)
PCLU_CFLAGS          = -w
PCLU_CFLAGS_DEBUG    = -w
PCLU_CFLAGS_OPTIMIZE = -w -O2

##############################################################################
# Pass options for compiling driver.o
DRIVER_OPTIONS = \
    -DCLUHOME="\"$(PCLU_CLUHOME)\"" \
    -DC_COMPILER="\"$(PCLU_CC)\"" \
    -DCFLAGS_NORMAL="\"$(PCLU_CFLAGS)\"" \
    -DCFLAGS_DEBUG="\"$(PCLU_CFLAGS_DEBUG)\"" \
    -DCFLAGS_OPTIMIZE="\"$(PCLU_CFLAGS_OPTIMIZE)\""

OBJS = driver.o buffer.o error.o wordlist.o
SRCS = driver.c buffer.c error.c wordlist.c

PCLU: $(OBJS)
	$(CC) -o PCLU $(OBJS)

driver.o:
	$(CC) ${CFLAGS} $(DRIVER_OPTIONS) -c driver.c

clean:
	rm -f PCLU $(OBJS)

driver.o: bool.h buffer.h proto.h error.h wordlist.h
buffer.o: buffer.h proto.h wordlist.h bool.h
error.o: error.h proto.h
wordlist.o: wordlist.h bool.h proto.h
