aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2018-11-30 15:58:18 +0100
committerAnton Khirnov <anton@khirnov.net>2018-11-30 15:58:18 +0100
commit1ac741602f8ec4bee73cdc8931529ea770a5c8e7 (patch)
treef6f4925ba9d9e3b328f927f0c2b263cd0f885c8d
parente7d7e9be158033c62f3a4b8537e984e4500fd44b (diff)
Makefile: allow overriding the compiler
-rw-r--r--Makefile9
1 files changed, 5 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 2945c0b..6a682f1 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,7 @@ TARGET = libteukolskydata.so
CFLAGS = -std=c99 -D_XOPEN_SOURCE=700 -fPIC -g -I.
TARGET_LDFLAGS = -Wl,--version-script=libteukolskydata.v -shared -lm -llapacke -pthread
TEST_LIBS = -lm -llapacke -lcblas -lpthread
+CC = cc
OBJS = basis.o \
bicgstab.o \
@@ -23,10 +24,10 @@ TESTPROGS := $(addprefix tests/,$(TESTPROGS))
all: $(TARGET)
$(TARGET): $(OBJS)
- cc ${TARGET_LDFLAGS} -o $@ $(OBJS)
+ $(CC) ${TARGET_LDFLAGS} -o $@ $(OBJS)
%.o: %.c
- cc $(CFLAGS) -MMD -MF $(@:.o=.d) -MT $@ -c -o $@ $<
+ $(CC) $(CFLAGS) -MMD -MF $(@:.o=.d) -MT $@ -c -o $@ $<
%.o: %.asm
yasm -f elf -m amd64 -M $< > $(@:.o=.d)
@@ -36,10 +37,10 @@ clean:
-rm -f *.o *.d *.pyc $(TARGET)
tests/%.o: tests/%.c
- cc $(CFLAGS) -MMD -MF $(@:.o=.d) -MT $@ -c -o $@ $<
+ $(CC) $(CFLAGS) -MMD -MF $(@:.o=.d) -MT $@ -c -o $@ $<
tests/%: tests/%.o $(OBJS)
- cc -o $@ $(@:=.o) $(OBJS) $(TEST_LIBS)
+ $(CC) -o $@ $(@:=.o) $(OBJS) $(TEST_LIBS)
test: $(TARGET) $(TESTPROGS)
LD_LIBRARY_PATH=. PYTHONPATH=. ./tests/convergence.py