Skip to content

Commit

Permalink
Merge pull request #5 from mockingbirdnest/Makefile
Browse files Browse the repository at this point in the history
A simple Makefile for core-math
  • Loading branch information
pleroy authored Oct 26, 2024
2 parents bd7af5b + 0d2703f commit 1cf76fc
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 1cf76fc

Please sign in to comment.