freebsd-ports/lang/p2c/files/patch-Makefile
Pawel Pekala 0fbec82b2e - Fix build with clang
- Add LICENSE
- Support staging

PR:		ports/184820
Submitted by:	KATO Tsuguru <tkato432@yahoo.com>
2013-12-19 16:17:39 +00:00

68 lines
1.8 KiB
Text

--- Makefile.orig
+++ Makefile
@@ -19,29 +19,30 @@
SHELL = /bin/sh
# Directories (private version)
-HOMEDIR = ../home
-INCDIR = ../home/p2c
-BINDIR = ..
-LIBDIR = ../home
-MANDIR = ../home
-MANFILE = p2c.cat # human-readable manual (for cat.1)
+#HOMEDIR = ../home
+#INCDIR = ../home/p2c
+#BINDIR = ..
+#LIBDIR = ../home
+#MANDIR = ../home
+#MANFILE = p2c.cat # human-readable manual (for cat.1)
#MANFILE = p2c.man.inst # uncompressed nroff source (for man.1)
#MANFILE = p2c.man.Z # compressed nroff source (for man.1.Z)
# Directories (public version)
-#HOMEDIR = /usr/lib/p2c
-#INCDIR = /usr/include/p2c
-#BINDIR = /usr/bin
-#LIBDIR = /usr/lib
-#MANDIR = /usr/man/man1
-#MANFILE = p2c.man.inst
+PREFIX ?= /usr/local
+HOMEDIR = $(PREFIX)/lib/p2c
+INCDIR = $(PREFIX)/include/p2c
+BINDIR = $(PREFIX)/bin
+LIBDIR = $(PREFIX)/lib
+MANDIR = $(PREFIX)/man/man1
+MANFILE = p2c.man.inst
# Compiler options
-CC = cc # you may wish to use gcc here instead
+CC ?= cc # you may wish to use gcc here instead
OPT = # -O # uncomment this for optimization
DEB = # -g # uncomment this for debugging
DEFS = # place other -D types of things here
-CFLAGS = $(OPT) $(DEB) $(DEFS)
+CFLAGS += $(OPT) $(DEB) $(DEFS)
LFLAGS =
@@ -64,9 +65,9 @@
LIBOBJS = p2clib.o loc.p2clib.o
OTHERLIBOBJS =
-ABSHOMEDIR = `cd $(HOMEDIR); pwd`
-ABSINCDIR = `cd $(INCDIR); pwd`
-ABSLIBDIR = `cd $(LIBDIR); pwd`
+ABSHOMEDIR = $(HOMEDIR)
+ABSINCDIR = $(INCDIR)
+ABSLIBDIR = $(LIBDIR)
MISCSRCS = makeproto.c
PROTOS = p2c.proto p2c.hdrs
@@ -128,7 +129,6 @@
sed -e "s;--HOMEDIR--;$(ABSHOMEDIR);" \
-e "s;--INCDIR--;$(ABSINCDIR);" \
-e "s;--LIBDIR--;$(ABSLIBDIR);" \
- -e "s;/bin/perl;`which perl`;" \
p2cc.perl >p2cc
chmod a+x p2cc