pkgsrc/sysutils/tree/patches/patch-ab
2009-08-08 05:20:02 +00:00

61 lines
1.5 KiB
Text

$NetBSD: patch-ab,v 1.4 2009/08/08 05:20:02 tnn Exp $
--- Makefile.orig 2007-06-11 22:22:47.000000000 +0900
+++ Makefile
@@ -8,7 +8,8 @@
CC=gcc
#CFLAGS=-ggdb -Wall -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-CFLAGS=-O2 -Wall -fomit-frame-pointer -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+CDEFS=-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+CFLAGS=-O2 -Wall -fomit-frame-pointer
LDFLAGS=-s
# Uncomment for FreeBSD:
@@ -38,13 +39,18 @@ LDFLAGS=-s
#CFLAGS=-02 -Wall -fomit-frame-pointer -Zomf -Zsmall-conv
#LDFLAGS=-s -Zomf -Zsmall-conv
-prefix = /usr
+PREFIX = /NONEXISTENT
VERSION=1.5.1.1
TREE_DEST=tree
-BINDIR=${prefix}/bin
+BINDIR=${PREFIX}/bin
MAN=tree.1
-MANDIR=${prefix}/man/man1
+MANSUBDIR=man
+MANDIR=${PREFIX}/${MANSUBDIR}/man1
+INSTALL_PROGRAM_DIR=install -d
+INSTALL_PROGRAM=install -s
+INSTALL_MAN_DIR=install -d
+INSTALL_MAN=install
all: tree
@@ -52,6 +58,7 @@ tree: tree.o
$(CC) $(LDFLAGS) -o $(TREE_DEST) tree.o
tree.o: tree.c
+ $(CC) -c $(CFLAGS) $(CDEFS) -o $@ $<
clean:
if [ -x $(TREE_DEST) ]; then rm $(TREE_DEST); fi
@@ -59,12 +66,12 @@ clean:
rm -f *~
install:
- install -d $(BINDIR)
- install -d $(MANDIR)
+ $(INSTALL_PROGRAM_DIR) $(DESTDIR)$(BINDIR)
+ $(INSTALL_MAN_DIR) $(DESTDIR)$(MANDIR)
if [ -e $(TREE_DEST) ]; then \
- install -s $(TREE_DEST) $(BINDIR)/$(TREE_DEST); \
+ $(INSTALL_PROGRAM) $(TREE_DEST) $(DESTDIR)$(BINDIR)/$(TREE_DEST); \
fi
- install man/$(MAN) $(MANDIR)/$(MAN)
+ $(INSTALL_MAN) man/$(MAN) $(DESTDIR)$(MANDIR)/$(MAN)
distclean:
if [ -f tree.o ]; then rm *.o; fi