1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-04 22:33:27 +00:00
freebsd-ports/lang/m3gdb/files/patch-aa
1999-09-10 00:40:04 +00:00

138 lines
3.6 KiB
Plaintext

--- Makefile.orig Wed Feb 17 09:55:20 1999
+++ Makefile Wed Sep 8 09:35:39 1999
@@ -1,23 +1,25 @@
# $Id: Makefile,v 1.38 1998/10/15 14:15:09 bde Exp $
-PROG = m3gdb
+PROG= m3gdb
-GDBDIR= ${.CURDIR}/../../../../contrib/gdb
-.if ${OBJFORMAT} == elf
-BFDDIR= ${.CURDIR}/../../binutils/libbfd/${MACHINE_ARCH}
-BINDIR= /usr/local/bin
+FBSDGDBDIR= ${.CURDIR}/src/gnu/usr.bin/gdb/gdb
+
+GDBDIR= ${FBSDGDBDIR}/../../../../contrib/gdb
+
+.if ${PORTOBJFORMAT} == elf
+BFDDIR= ${FBSDGDBDIR}/../../binutils/libbfd/${MACHINE_ARCH}
.else
-BFDDIR= ${.CURDIR}/../bfd
-BINDIR= /usr/local/bin/aout
+BFDDIR= ${FBSDGDBDIR}/../bfd
.endif
-MANDIR= /usr/local/man/man
-FBSDGDB=${.CURDIR}/../gdb
-.PATH: ${FBSDGDB}
+BINDIR= ${PREFIX}/bin
+MANDIR= ${PREFIX}/man/man
+
+.PATH: ${FBSDGDBDIR}
.PATH: ${GDBDIR}/gdb
.PATH: ${GDBDIR}/opcodes
-.if ${OBJFORMAT} == elf
+.if ${PORTOBJFORMAT} == elf
CFLAGS+= -DFREEBSD_ELF
.endif
CFLAGS+= -DNEED_DECLARATION_FREE
@@ -50,6 +52,9 @@
m3-lang.c m3-token.c m3-uid.c
SRCS= init.c ${XSRCS}
+.PHONY: show check libdepend libbuild beforedepend afterdepend
+.PHONY: links localclean
+
show:
@echo ${XSRCS}
@@ -60,7 +65,34 @@
@cd ${.CURDIR} && wc *-files
@echo ""
-beforedepend:
+beforedepend: libdepend
+#afterdepend: libbuild # too ugly, call it explicitly in pre-build
+
+.if ${PORTOBJFORMAT} == elf
+LIBBFDDIR= ${FBSDGDBDIR}/../../binutils/libbfd
+LIBIBERTYDIR= ${FBSDGDBDIR}/../../binutils/libiberty
+.else
+LIBBFDDIR= ${FBSDGDBDIR}/../bfd
+LIBIBERTYDIR= ${FBSDGDBDIR}/../libiberty
+.endif
+
+LIBBFDOBJ= ${.CURDIR}/../libbfd
+LIBIBERTYOBJ= ${.CURDIR}/../libiberty
+
+libdepend:
+ @echo building dependencies in ${LIBBFDDIR}
+ @mkdir -p ${LIBBFDOBJ}
+ @cd ${LIBBFDDIR} && MAKEOBJDIR=${LIBBFDOBJ} make depend
+ @echo building dependencies in ${LIBIBERTYDIR}
+ @mkdir -p ${LIBIBERTYOBJ}
+ @cd ${LIBIBERTYDIR} && MAKEOBJDIR=${LIBIBERTYOBJ} make depend
+
+libbuild:
+ @echo building libbfd.a
+ @cd ${LIBBFDDIR} && MAKEOBJDIR=${LIBBFDOBJ} make all
+ @echo building libiberty.a
+ @cd ${LIBIBERTYDIR} && MAKEOBJDIR=${LIBIBERTYOBJ} make all
+
links:
@cd ${.CURDIR} && ${.CURDIR}/link-non-local-files.sh
@@ -69,7 +101,12 @@
@cd ${.CURDIR} && ${.CURDIR}/rm-all-links.sh
cd ${.CURDIR} && rm -f ${.CURDIR}/*.core ${.CURDIR}/*~
-CFLAGS+= -I- -I$(.CURDIR) -I${FBSDGDB} -I${DESTDIR}/usr/include/readline -I${BFDDIR}
+CFLAGS+= -I- -I$(.CURDIR) -I${FBSDGDBDIR}
+CFLAGS+= -I${DESTDIR}/usr/include/readline -I${BFDDIR}
+CFLAGS+= -I${GDBDIR}/include -I${GDBDIR}/gdb -I${GDBDIR}/bfd
+CFLAGS+= -I${GDBDIR}/libiberty -I${GDBDIR}/gdb/config
+CFLAGS+= -DHAVE_CONFIG_H
+
# use phkmalloc
CFLAGS+= -DNO_MMALLOC
# uncomment the next line if you want to debug gdb
@@ -78,35 +115,8 @@
CLEANFILES= init.c init.c-tmp
-.if ${OBJFORMAT} == elf
-
-.if exists(${.OBJDIR}/../../binutils/libbfd)
-LIBBFD= ${.OBJDIR}/../../binutils/libbfd/libbfd.a
-.else
-LIBBFD= ${.CURDIR}/../../binutils/libbfd/libbfd.a
-.endif
-
-.if exists(${.OBJDIR}/../../binutils/libiberty)
-LIBIBERTY= ${.OBJDIR}/../../binutils/libiberty/libiberty.a
-.else
-LIBIBERTY= ${.CURDIR}/../../binutils/libiberty/libiberty.a
-.endif
-
-.else
-
-.if exists(${.OBJDIR}/../bfd)
-LIBBFD= ${.OBJDIR}/../bfd/libbfd.a
-.else
-LIBBFD= ${.CURDIR}/../bfd/libbfd.a
-.endif
-
-.if exists(${.OBJDIR}/../libiberty)
-LIBIBERTY= ${.OBJDIR}/../libiberty/libiberty.a
-.else
-LIBIBERTY= ${.CURDIR}/../libiberty/libiberty.a
-.endif
-
-.endif # OBJFORMAT
+LIBBFD= ${LIBBFDOBJ}/libbfd.a
+LIBIBERTY= ${LIBIBERTYOBJ}/libiberty.a
DPADD= ${LIBBFD} ${LIBREADLINE} ${LIBGNUREGEX} ${LIBIBERTY} ${LIBTERMCAP}
LDADD= ${LIBBFD} -lreadline -lgnuregex ${LIBIBERTY} -ltermcap