1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-13 03:03:15 +00:00
freebsd-ports/devel/libcli/files/patch-Makefile
Ryan Steinmetz fbcab7a0bf - Honor custom PREFIX
PR:		ports/168008
Submitted by:	zi@
Approved by:	bapt@ (maintainer)
2012-05-17 12:34:09 +00:00

55 lines
1.7 KiB
Plaintext

--- ./Makefile.orig 2011-05-03 22:52:15.000000000 -0400
+++ ./Makefile 2012-05-17 07:17:09.000000000 -0400
@@ -1,23 +1,21 @@
UNAME = $(shell sh -c 'uname -s 2>/dev/null || echo not')
DESTDIR =
-PREFIX = /usr/local
+PREFIX ?= /usr/local
MAJOR = 1
MINOR = 9
REVISION = 5
LIB = libcli.so
-CC = gcc
-DEBUG = -g
-OPTIM = -O3
-CFLAGS += $(DEBUG) $(OPTIM) -Wall -Wformat-security -Wno-format-zero-length
+CC ?= gcc
+CFLAGS += -Wall -Wformat-security -Wno-format-zero-length
LDFLAGS += -shared
LIBPATH += -L.
ifeq ($(UNAME),Darwin)
LDFLAGS += -Wl,-install_name,$(LIB).$(MAJOR).$(MINOR)
else
-LDFLAGS += -Wl,-soname,$(LIB).$(MAJOR).$(MINOR)
+LDFLAGS += -Wl,-soname,$(LIB).$(MAJOR)$(MINOR)
LIBS = -lcrypt
endif
@@ -26,8 +24,9 @@
$(LIB): libcli.o
$(CC) -o $(LIB).$(MAJOR).$(MINOR).$(REVISION) $^ $(LDFLAGS) $(LIBS)
-rm -f $(LIB) $(LIB).$(MAJOR).$(MINOR)
- ln -s $(LIB).$(MAJOR).$(MINOR).$(REVISION) $(LIB).$(MAJOR).$(MINOR)
- ln -s $(LIB).$(MAJOR).$(MINOR) $(LIB)
+ ln -sf $(LIB).$(MAJOR).$(MINOR).$(REVISION) $(LIB).$(MAJOR).$(MINOR)
+ ln -sf $(LIB).$(MAJOR).$(MINOR).$(REVISION) $(LIB).$(MAJOR)$(MINOR)
+ ln -sf $(LIB).$(MAJOR).$(MINOR) $(LIB)
%.o: %.c
$(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ -c $<
@@ -48,8 +47,9 @@
install -m 0644 libcli.h $(DESTDIR)$(PREFIX)/include
install -m 0755 $(LIB).$(MAJOR).$(MINOR).$(REVISION) $(DESTDIR)$(PREFIX)/lib
cd $(DESTDIR)$(PREFIX)/lib && \
- ln -s $(LIB).$(MAJOR).$(MINOR).$(REVISION) $(LIB).$(MAJOR).$(MINOR) && \
- ln -s $(LIB).$(MAJOR).$(MINOR) $(LIB)
+ ln -sf $(LIB).$(MAJOR).$(MINOR).$(REVISION) $(LIB).$(MAJOR).$(MINOR) && \
+ ln -sf $(LIB).$(MAJOR).$(MINOR).$(REVISION) $(LIB).$(MAJOR)$(MINOR) && \
+ ln -sf $(LIB).$(MAJOR).$(MINOR) $(LIB)
rpm:
mkdir libcli-$(MAJOR).$(MINOR).$(REVISION)