diff --git a/Makefile b/Makefile index a55da59..95f61f9 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ -AR = ar -CC = gcc +AR ?= ar +CC ?= gcc +PREFIX ?= /usr/local + CFLAGS = -O3 -std=c99 -Wall SRCS = src/list.c \ @@ -11,6 +13,12 @@ OBJS = $(SRCS:.c=.o) all: build/liblist.a +install: all + cp -f build/liblist.a $(PREFIX)/lib/liblist.a + +uninstall: + rm -f $(PREFIX)/lib/liblist.a + build/liblist.a: $(OBJS) @mkdir -p build $(AR) rcs $@ $^ @@ -35,4 +43,4 @@ test: bin/test benchmark: bin/benchmark @./$< -.PHONY: test benchmark clean \ No newline at end of file +.PHONY: test benchmark clean install uninstall \ No newline at end of file