CXX=g++
C=gcc

uname_m := $(shell uname -m)
ifeq ($(uname_m),armv7l)
CFLAGS=-O3  -march=armv7-a -mtune=cortex-a8 -mfpu=neon -ftree-vectorize -lrt `pkg-config --cflags --libs glib-2.0`
else
ifeq ($(uname_m),armv6l)
CFLAGS=-O3   -march=armv6 -mfpu=vfp -mfloat-abi=hard -lrt `pkg-config --cflags --libs glib-2.0`
else
CFLAGS=-O3 `pkg-config --cflags --libs glib-2.0`
endif
endif



%.o: %.c 
	$(C) -c -o $@ $< $(CFLAGS)

one_round_new.o: one_round_new.cpp 
	$(CXX) -c -o $@ $< $(CFLAGS)

one_round_new3.o: one_round_new3.cpp 
	$(CXX) -c -o $@ $< $(CFLAGS)

one_round_new4.o: one_round_new4.cpp 
	$(CXX) -c -o $@ $< $(CFLAGS)


one_round_steph.o: one_round_steph.cpp 
	$(CXX) -c -o $@ $< $(CFLAGS)

one_round_auth.o: one_round_auth.cpp 
	$(CXX) -c -o $@ $< $(CFLAGS)


one_round_hash.o: one_round_hash.cpp 
	$(CXX) -c -o $@ $< $(CFLAGS)

one_round_hash_new.o: one_round_hash_new.cpp 
	$(CXX) -c -o $@ $< $(CFLAGS)

one_round_hash_new2.o: one_round_hash_new2.cpp 
	$(CXX) -c -o $@ $< $(CFLAGS)

one_round_hash_new3.o: one_round_hash_new3.cpp 
	$(CXX) -c -o $@ $< $(CFLAGS)


one_round_par2.o: one_round_par2.cpp 
	$(CXX)  -fopenmp -c -o $@ $< $(CFLAGS)

one_round_new: pixmap_io.o one_round_new.o 
	$(CXX)  -o $@ $^ $(CFLAGS)

one_round_new3: pixmap_io.o one_round_new3.o 
	$(CXX)  -o $@ $^ $(CFLAGS)

one_round_new4: pixmap_io.o one_round_new4.o 
	$(CXX)  -o $@ $^ $(CFLAGS)

one_round_steph: pixmap_io.o one_round_steph.o 
	$(CXX)  -o $@ $^ $(CFLAGS)


one_round_par2: pixmap_io.o one_round_par2.o 
	$(CXX) -fopenmp -o $@ $^ $(CFLAGS)


one_round_hash: pixmap_io.o one_round_hash.o 
	$(CXX)  -o $@ $^ $(CFLAGS)

one_round_hash_new: pixmap_io.o one_round_hash_new.o 
	$(CXX)  -o $@ $^ $(CFLAGS)

one_round_hash_new2: pixmap_io.o one_round_hash_new2.o 
	$(CXX)  -o $@ $^ $(CFLAGS)

one_round_hash_new3: pixmap_io.o one_round_hash_new3.o 
	$(CXX)  -o $@ $^ $(CFLAGS)

rc4_hash: pixmap_io.o rc4_hash.o 
	$(CXX)  -o $@ $^ $(CFLAGS)

rc4_hash2: pixmap_io.o rc4_hash2.o 
	$(CXX)  -o $@ $^ $(CFLAGS)

rc4_hash3: pixmap_io.o rc4_hash3.o 
	$(CXX)  -o $@ $^ $(CFLAGS)

one_round_auth: pixmap_io.o one_round_auth.o 
	$(CXX)  -o $@ $^ $(CFLAGS)

clean:
	rm -rf *.o one_round_new one_round_new4 one_round_hash one_round_par2 one_round_hash_new  rc4_hash rc4_hash2  rc4_hash3 one_round_steph