# makefile for nauty 2.0
# define CCMD for C compiler
# define LD if dreadnaut needs any loader arguments

CCMD=cc -c -O3
LD=
SMALL=-DMAXN=WORDSIZE
DYNAMIC=-DMAXN=0

all: dreadnaut dreadnaut1

dreadnaut: dreadnaut.o naututil.o nauty.o nautil.o nautinv.o rng.o
	cc -o dreadnaut \
	    dreadnaut.o naututil.o nauty.o nautil.o nautinv.o rng.o ${LD}
dreadnaut.o: nauty.h naututil.h dreadnaut.c
	${CCMD} ${DYNAMIC} dreadnaut.c
naututil.o: nauty.h naututil.h naututil.c
	${CCMD} ${DYNAMIC} naututil.c
nautil.o: nauty.h nautil.c
	${CCMD} ${DYNAMIC} nautil.c
nauty.o: nauty.h nauty.c
	${CCMD} ${DYNAMIC} nauty.c
nautinv.o: nauty.h naututil.h nautinv.c
	${CCMD} ${DYNAMIC} nautinv.c
nautaux.o: nautaux.h nauty.h naututil.h nautaux.c
	${CCMD} ${DYNAMIC} nautaux.c

dreadnaut1: dreadnaut1.o naututil1.o nauty1.o nautil1.o nautinv1.o rng.o
	cc -o dreadnaut1 \
	    dreadnaut1.o naututil1.o nauty1.o nautil1.o nautinv1.o rng.o ${LD}
dreadnaut1.o: nauty.h naututil.h dreadnaut.c
	${CCMD} ${SMALL} -o dreadnaut1.o dreadnaut.c
naututil1.o: nauty.h naututil.h naututil.c
	${CCMD} ${SMALL} -o naututil1.o naututil.c
nautil1.o: nauty.h nautil.c
	${CCMD} ${SMALL} -o nautil1.o nautil.c
nauty1.o: nauty.h nauty.c
	${CCMD} ${SMALL} -o nauty1.o nauty.c
nautinv1.o: nauty.h naututil.h nautinv.c
	${CCMD} ${SMALL} -o nautinv1.o nautinv.c
nautaux1.o: nautaux.h nauty.h naututil.h nautaux.c
	${CCMD} ${SMALL} -o nautaux1.o nautaux.c

rng.o: rng.c
	${CCMD} rng.c

archive : 
	mkdir nauty20
	cp dreadnaut.c nautaux.h nauty.h nautil.c nautyex.c makefile \
           nautinv.c naututil.c nautyex.c read.me naututil.h nautaux.c \
           nauty.c rng.c rng.h nauty20
	tar cvf nauty20.tar nauty20
	compress nauty20.tar
	rm -r nauty20
