GAPPATH=/build/gap/src/gap-4.10.1
PM_CFLAGS=-DPOLYMAKE_VERSION=304 -fPIC -pipe -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -O2 -pipe -fstack-protector-strong -fno-plt -std=c++14 -ftemplate-depth-200 -fno-strict-aliasing -Wno-parentheses -Wshadow -fopenmp -Wno-error=unused-function -O1 -DPOLYMAKE_DEBUG=0 -I/usr/include -I/usr/include/polymake/external
PM_LDFLAGS=-lpolymake -lpolymake-apps -lmpfr -lpthread -ldl -lxml2 -lz -llzma -licui18n -licuuc -licudata -lm -ldl -L/usr/lib -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -Wl,--no-keep-memory -Wl,--reduce-memory-overheads -fopenmp -Wl,-E -Wl,-rpath,/usr/lib
CXX=g++
# sample makefile

targets: default

# this target creates a bin-directory
bindir:
	mkdir -p bin/armv7l-unknown-linux-gnueabihf-default32-kv3

default: bindir bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_main.so

bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_data.o: src/polymake_data.cpp src/polymake_data.h src/loadgap.h
	cp $(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/config.h bin/armv7l-unknown-linux-gnueabihf-default32-kv3/
	$(CXX) $(PM_CFLAGS) -fPIC -Wall -O0 -g -pipe -m32 -o bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_data.o -I$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/extern/gmp/include -I$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/../.. -I$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3 -DCONFIG_H -c src/polymake_data.cpp	

bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_fktn.o: src/polymake_fktn.cpp src/polymake_fktn.h src/loadgap.h src/polymake_data.h
	cp $(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/config.h bin/armv7l-unknown-linux-gnueabihf-default32-kv3/
	$(CXX) $(PM_CFLAGS) -fPIC -Wall -O0 -g -pipe -m32 -o bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_fktn.o -I$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/extern/gmp/include -I$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/../.. -I$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3 -DCONFIG_H -c src/polymake_fktn.cpp	

bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_fan.o: src/polymake_fan.cpp src/polymake_fan.h src/loadgap.h src/polymake_data.h src/polymake_templates.h
	cp $(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/config.h bin/armv7l-unknown-linux-gnueabihf-default32-kv3/
	$(CXX) $(PM_CFLAGS) -fPIC -Wall -O0 -g -pipe -m32 -o bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_fan.o -I$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/extern/gmp/include -I$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/../.. -I$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3 -DCONFIG_H -c src/polymake_fan.cpp	

bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_tropical.o: src/polymake_tropical.cpp src/polymake_tropical.h src/loadgap.h src/polymake_data.h src/polymake_templates.h
	cp $(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/config.h bin/armv7l-unknown-linux-gnueabihf-default32-kv3/
	$(CXX) $(PM_CFLAGS) -fPIC -Wall -O0 -g -pipe -m32 -o bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_tropical.o -I$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/extern/gmp/include -I$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/../.. -I$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3 -DCONFIG_H -c src/polymake_tropical.cpp	

bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_cone.o: src/polymake_cone.cpp src/polymake_cone.h src/loadgap.h src/polymake_data.h src/polymake_templates.h
	cp $(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/config.h bin/armv7l-unknown-linux-gnueabihf-default32-kv3/
	$(CXX) $(PM_CFLAGS) -fPIC -Wall -O0 -g -pipe -m32 -o bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_cone.o -I$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/extern/gmp/include -I$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/../.. -I$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3 -DCONFIG_H -c src/polymake_cone.cpp	

bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_polytopes.o: src/polymake_polytopes.cpp src/polymake_polytopes.h src/loadgap.h src/polymake_data.h src/polymake_templates.h
	cp $(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/config.h bin/armv7l-unknown-linux-gnueabihf-default32-kv3/
	$(CXX) $(PM_CFLAGS) -fPIC -Wall -O0 -g -pipe -m32 -o bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_polytopes.o -I$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/extern/gmp/include -I$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/../.. -I$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3 -DCONFIG_H -c src/polymake_polytopes.cpp

bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_matroid.o: src/polymake_matroid.cpp src/polymake_matroid.h src/loadgap.h src/polymake_data.h src/polymake_templates.h
	cp $(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/config.h bin/armv7l-unknown-linux-gnueabihf-default32-kv3/
	$(CXX) $(PM_CFLAGS) -fPIC -Wall -O0 -g -pipe -m32 -o bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_matroid.o -I$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/extern/gmp/include -I$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/../.. -I$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3 -DCONFIG_H -c src/polymake_matroid.cpp	

bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_main.o: src/polymake_main.cpp src/polymake_fktn.h src/polymake_tropical.h src/polymake_polytopes.h src/loadgap.h src/polymake_data.h src/polymake_cone.h src/polymake_fan.h src/polymake_templates.h src/polymake_matroid.h
	cp $(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/config.h bin/armv7l-unknown-linux-gnueabihf-default32-kv3/
	$(CXX) $(PM_CFLAGS) -fPIC -Wall -O0 -g -pipe -m32 -o bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_main.o -I$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/extern/gmp/include -I$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/../.. -I$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3 -DCONFIG_H -c src/polymake_main.cpp

clean:
	rm -rf bin Makefile

docclean:
	(cd doc; ./clean)

doc: doc/manual.six

doc/manual.six: makedoc.g \
		PackageInfo.g \
		doc/*.autodoc \
		gap/*.gd gap/*.gi
		gap makedoc.g

test:   doc

bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_main.so: bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_fktn.o bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_main.o bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_polytopes.o bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_cone.o bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_fan.o bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_data.o bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_tropical.o bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_matroid.o
	$(CXX) -fPIC -Wall -O0 -g -shared -m32 -o bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_main.so bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_main.o bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_fktn.o bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_tropical.o bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_polytopes.o bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_cone.o bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_fan.o bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_matroid.o bin/armv7l-unknown-linux-gnueabihf-default32-kv3/polymake_data.o $(PM_LDFLAGS) -L$(GAPPATH)/bin/armv7l-unknown-linux-gnueabihf-default32-kv3/extern/gmp/lib -lgmp
