From 29db4e615e4bfdf6ec107e5cdd1547403eb2a6e4 Mon Sep 17 00:00:00 2001 From: leiyu3 Date: Thu, 22 Sep 2022 09:39:20 -0400 Subject: change to static library --- Makefile | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d37a3a1..14ec6f7 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,17 @@ CC=clang +CFLAGS=-Wall -g +BINS = vector.o libvector.a main test +all: $(BINS) -main: main.c - gcc main.c -o main +vector.o: vector.h libvector.c + $(CC) $(CFLAGS) -c libvector.c + +libvector.a: libvector.o + ar -cvq libvector.a libvector.o + +main: main.c libvector.a + $(CC) $(CFLAGS) -o $@ $^ + +test: test.c + gcc test.c -o test -lcriterion -- cgit v1.2.3