aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorepochqwert <epoch@hacking.allowed.org>2019-03-12 17:27:16 +0000
committerepochqwert <epoch@hacking.allowed.org>2019-03-12 17:27:16 +0000
commit68cdf93f9ed722c08e63771e875721d3b0165509 (patch)
treeb160d80a7a1fa4be3b1baf071870afea991c0e25
parentc3856f9f1db26ab379dae9e750dc7b8b42705255 (diff)
downloadlibhashtable-68cdf93f9ed722c08e63771e875721d3b0165509.tar.gz
libhashtable-68cdf93f9ed722c08e63771e875721d3b0165509.zip
changed cp to install, optional override of PREFIX, use LD insted of expecting make to know how to build a shared lib.
-rw-r--r--Makefile14
1 files 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)