openbsd-ports/comms/malsync/patches/patch-mal_client_unix_Makefile
naddy df354b5ec5 - distfile has changed
- respect CC and CFLAGS
- clean-up
ok pvalchev@
2001-10-16 12:34:22 +00:00

57 lines
1.3 KiB
Plaintext

$OpenBSD: patch-mal_client_unix_Makefile,v 1.1 2001/10/16 12:34:23 naddy Exp $
--- mal/client/unix/Makefile.orig Sun May 14 23:17:35 2000
+++ mal/client/unix/Makefile Mon Oct 15 17:03:45 2001
@@ -1,4 +1,4 @@
-CC = gcc
+#CC = gcc
TARGET = malsync
PLAT := $(shell uname)
@@ -12,9 +12,18 @@ LINKLIBS = -ldl -lm
endif
TREETOP = ../../..
+ifeq ($(PLAT),OpenBSD)
+PILOT_LINK_DIR = ${PREFIX}
+PILOT_LINK_LIB = ${PILOT_LINK_DIR}/lib
+else
PILOT_LINK_DIR = $(TREETOP)/vendor/pilot/pilot-link.0.9.3
+PILOT_LINK_LIB = ${PILOT_LINK_DIR}/libsock
+endif
+
+BINDIR=${PREFIX}/bin
+DOCDIR=${PREFIX}/share/doc/malsync
-CFLAGS = -Wall -g -DMALSYNC -I$(TREETOP)/mal/common \
+CFLAGS += -DMALSYNC -I$(TREETOP)/mal/common \
-I$(TREETOP)/mal/client/common -I$(PILOT_LINK_DIR)/include -I.
@@ -55,17 +64,23 @@ endif
OBJS = $(SRC:.c=.o)
+all:${TARGET}
$(TARGET): $(OBJS)
$(CC) -rdynamic $(CFLAGS) -o $@ $(OBJS) \
- -L${PILOT_LINK_DIR}/libsock -lpisock $(LINKLIBS)
+ -L${PILOT_LINK_LIB} -lpisock $(LINKLIBS)
clean:
rm -f $(OBJS) $(TARGET)
.c.o:
- gcc $(CFLAGS) -c -o $@ $<
-
+ $(CC) $(CFLAGS) -c -o $@ $<
+install: ${TARGET}
+ install -c ${TARGET} ${BINDIR}
+ @if [ -d ${DOCDIR} ]; then set +x; \
+ else (set -x; mkdir -p ${DOCDIR}); fi
+ install -c -m 0644 ${TREETOP}/Doc/README* ${DOCDIR}
+ install -c -m 0644 ${TREETOP}/mal/MPL-* ${DOCDIR}