# Sample makefile for building production executables from CLU sources

CLU     = ${CLUHOME}/exe/pclu                    # the compiler
CFLAGS  = -I${CLUHOME}/include -w -O2 -c         # flags to the C compiler
LDFLAGS = -L${CLUHOME}/code -lpclu -lgc -lm      # flags to the C linker

OBJS = factorial.o 

factorial: ${OBJS}
	${CC} -o $@ ${OBJS} ${LDFLAGS}

factorial.o: factorial.clu
	rm -f factorial.c
	${CLU} -ext false -spec factorial -opt -co factorial

clean:
	rm -f ${OBJS} factorial factorial.c
