From a64ba14ff2c6041a4d5b0413e524f2f7a7e3674e Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Wed, 29 Apr 2020 19:21:12 -0400 Subject: 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 --- Makefile | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'Makefile') 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 : -- cgit v1.2.3-13-gbd6f