#!/usr/bin/make

C_FILES = $(wildcard *.c)
OBJ_FILES = $(patsubst %.c,%.o,$(C_FILES))

all: $(OBJ_FILES) cinc2017

cinc2017: array.o cinc2017.o conf.o data.o matrix.o mit.o mit.o rhythm.o tests.o trig.o
	$(CC) -o $@ -g -O2 $^ -lm

%.o: %.c
	$(CC) $(CCFLAGS) -g -c -o $@ $<

clean:
	rm $(OBJ_FILES)

entry:
	if [ -e entry.zip ]; then rm entry.zip; fi
	zip -r entry.zip AUTHORS.txt LICENSE.txt dependencies.txt Makefile next.sh setup.sh *.c *.h answers.txt

dryrun:
	if [ -e entry.zip ]; then rm entry.zip; fi
	zip -r entry.zip DRYRUN AUTHORS.txt LICENSE.txt dependencies.txt Makefile next.sh setup.sh *.c *.h answers.txt

