summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 18 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index cdc6662..959aaa4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,23 +1,32 @@
PREFIX := /usr/local
BIN_DIR := $(PREFIX)/bin
+ifdef DEBUG
+DEBUG_CFLAGS=-DDEBUG
+else
+DEBUG_CFLAGS=
+endif
+
ifdef PCC
PCC_CFLAGS=-D__float128="long double"
else
PCC_CFLAGS=
endif
-CFLAGS = $(PCC_CFLAGS) $(CFLAGS_EXTRA)
-OBJS = clld.c
-OBJ_NAME = clld
+CFLAGS = $(CFLAGS_EXTRA) $(PCC_CFLAGS) $(DEBUG_CFLAGS)
+OBJS = clld.o
all : clean $(OBJS)
- $(CC) $(OBJS) $(CFLAGS) -o $(OBJ_NAME)
-test-mvmt :
- $(CC) test-mvmt.c $(CFLAGS) -o test-mvmt
-benchmark: clean
- $(CC) clld-bench.c $(CFLAGS) -o clld-bench
+
+%.o : %.c
+ $(CC) -c $< -o $@ $(CFLAGS)
+test : all clld-test.o
+ $(CC) clld.o clld-test.o -o clld $(CFLAGS)
+test-mvmt : clean test
+ $(CC) test-mvmt.c -o test-mvmt $(CFLAGS)
+benchmark : all clld-bench.o
+ $(CC) clld.o clld-bench.o -o clld-bench $(CFLAGS)
clean :
- rm -f $(OBJ_NAME) test-mvmt clld-bench
+ rm -f clld test-mvmt clld-bench *.o
install :
install -D -m755 clld $(BIN_DIR)/clld
uninstall :