diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b946073 --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +UNAME_S := $(shell uname -s) + +CXX := clang++ +COMPILER_OPTIONS := \ + -std=c++1z -stdlib=libc++ -O3 -g \ + -fPIC -fexceptions -ferror-limit=1 -fno-omit-frame-pointer \ + -Wall -Wpedantic \ + -DNDEBUG -Iinclude + +LIBRARY_TRANSLATION_UNITS := \ + src/binary64/cos/cos.cc \ + src/binary64/sin/sin.cc +LIBRARY_OBJECTS := $(LIBRARY_TRANSLATION_UNITS:.cc=.o) + +ifeq ($(UNAME_S),Darwin) + COMPILER_OPTIONS += -mmacosx-version-min=10.11 -arch x86_64 +endif + +all: $(LIBRARY_OBJECTS) + ar -rcs libcore-math.a $^ + +clean: + rm -f src/*/*/*.o + +%.o: %.cc + $(CXX) -c -o $@ $< $(COMPILER_OPTIONS)