
CC = cc
#CFLAGS = -Wall -Wextra -std=c89
CFLAGS = -Wall -Wextra

WINCC = i686-w64-mingw32-gcc
WINSTRIP = i686-w64-mingw32-strip
WINCCOPTS = -funsigned-char -fpack-struct=1 -c -O -m32

all: vlsiencryptor vlsiencryptor.exe

testmain.o: testmain.c
	${CC} ${CFLAGS} -c testmain.c

chacha20.o:chacha20.c chacha20.h
	${CC} ${CFLAGS} -c chacha20.c

filecryptor.o:filecryptor.c
	${CC} ${CFLAGS} -c filecryptor.c

vlsiencryptor: filecryptor.o chacha20.o
	${CC} filecryptor.o chacha20.o -o vlsiencryptor -lm
	./vlsiencryptor -k my.key -i infile.txt

vlsiencryptor.exe: chacha20.c chacha20.h filecryptor.c
#	$(WINCC) -Wall -std=c89 -static -o $@ chacha20.c filecryptor.c -lpthread
	$(WINCC) -Wall -static -o $@ chacha20.c filecryptor.c -lpthread
	$(WINSTRIP) $@


.PHONY:clean

cleanall:
	rm -f ./*~ filecryptor.o chacha20.o testmain.o vlsiencryptor \\
		vlsiencryptor.exe

clean:
	rm -f ./*~ filecryptor.o chacha20.o testmain.o vlsiencryptor
