summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2020-04-29 19:21:12 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2020-04-29 19:21:12 -0400
commita64ba14ff2c6041a4d5b0413e524f2f7a7e3674e (patch)
tree63da170768def210ede25b1157a4edbcd57046a9 /Makefile
parent9797ea8be2220759eab9ec546f43c6b9a04c7cc5 (diff)
Converted clld to a library.
I did this to not only make it smaller, but to also make it faster, and to allow for other programs to use it more efficiently. Also, the original program is now in clld-test.c
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 :