summaryrefslogtreecommitdiff
path: root/devel/bncsutil-ghost++/files/patch-Makefile
blob: b3062f4a7f428c3e40126cdf514177163ec2f3e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--- Makefile
+++ Makefile
@@ -1,17 +1,15 @@
 SHELL = /bin/sh
 SYSTEM = $(shell uname)
-CXX = g++
-CXXFLAGS = -Wall -O3 -I ../ -Wno-multichar -fPIC
+CXXFLAGS = $(CFLAGS) -I ../ -Wno-multichar -fPIC
 CXXOBJ = bsha1.o cdkeydecoder.o checkrevision.o decodekey.o file.o libinfo.o oldauth.o
-CC = gcc
-CCFLAGS = -Wall -O3 -I ../ -Wno-multichar -fPIC
+CCFLAGS = $(CFLAGS) -I ../ -Wno-multichar -fPIC
 CCOBJ = nls.o pe.o sha1.o stack.o
 
 ifeq ($(SYSTEM),Darwin)
 LDFLAGS = -dynamiclib -lgmp -L/opt/local/lib
 TARGET = libbncsutil.dylib
 else
-LDFLAGS = -shared -lgmp
+LDFLAGS += -shared -lgmp -L/usr/local/lib
 TARGET = libbncsutil.so
 endif
 
@@ -26,11 +24,9 @@
 
 clean:
 	rm -f $(CCOBJ) $(CXXOBJ) $(TARGET) *~
-all:
-	make $(TARGET)
+all: $(TARGET)
 
 install: $(TARGET)
-	mkdir -p /usr/include/bncsutil
-	cp *.h /usr/include/bncsutil
-	cp $(TARGET) /usr/lib
-	ldconfig
+	mkdir -p $(PREFIX)/include/bncsutil
+	cp *.h $(PREFIX)/include/bncsutil
+	cp $(TARGET) $(PREFIX)/lib