From 68cdf93f9ed722c08e63771e875721d3b0165509 Mon Sep 17 00:00:00 2001 From: epochqwert Date: Tue, 12 Mar 2019 17:27:16 +0000 Subject: changed cp to install, optional override of PREFIX, use LD insted of expecting make to know how to build a shared lib. --- Makefile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 89e9937..25fb69d 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ ### why the fuck is this here? LDFLAGS=-lhashtable -Llibhashtable -CFLAGS=-fpic -shared -pedantic -Wall -PREFIX=/usr/local +CFLAGS=-fpic -shared -pedantic -Wall -g3 +PREFIX:=/usr/local TARGET=libhashtable.so all: $(TARGET) @@ -8,14 +8,18 @@ all: $(TARGET) libhashtable.h: ./genheader.sh -$(TARGET): libhashtable.c libhashtable.h +$(TARGET): libhashtable.o + ld -shared -o $(TARGET) libhashtable.o clean: rm -f libhashtable.so + rm *.o install: - cp $(TARGET) $(PREFIX)/lib/$(TARGET) - cp hashtable.h $(PREFIX)/include/hashtable.h + mkdir -p $(PREFIX)/lib + mkdir -p $(PREFIX)/include + install $(TARGET) $(PREFIX)/lib/$(TARGET) + install hashtable.h $(PREFIX)/include/hashtable.h uninstall: rm $(PREFIX)/lib/$(TARGET) -- cgit v1.2.3