From 0d2703f879f9a3707ab2e3fc7de659fd5851b157 Mon Sep 17 00:00:00 2001 From: pleroy Date: Sat, 26 Oct 2024 11:43:35 +0200 Subject: [PATCH] A simple Makefile for core-math. --- Makefile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Makefile 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)