aboutsummaryrefslogtreecommitdiff
path: root/lang/gnat_util/files/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'lang/gnat_util/files/Makefile')
-rw-r--r--lang/gnat_util/files/Makefile69
1 files changed, 69 insertions, 0 deletions
diff --git a/lang/gnat_util/files/Makefile b/lang/gnat_util/files/Makefile
new file mode 100644
index 000000000000..9112b7235a26
--- /dev/null
+++ b/lang/gnat_util/files/Makefile
@@ -0,0 +1,69 @@
+# To avoid a cirular dependency with GPRBuild, this custom BSD Makefile is
+# used instead of the provided asis.gpr file.
+# $FreeBSD$
+
+CP=cp -p
+MKDIR=mkdir -p
+SRC=gen_src
+ADA_FLAGS= -O2 -gnatn -gnatws -gnat05
+C_FLAGS= -O2
+ADB_SRCS!= cd ${.CURDIR} && ls *.adb | sort -r
+GEN_SRCS= sdefault.adb snames.adb xsnamest.adb
+ADS_SRCS= rident.ads hostparm.ads err_vars.ads alloc.ads prj-com.ads
+LIB_SRCS+= link.c ${GEN_SRCS} ${ADS_SRCS} ${ADB_SRCS:Nlib-*.adb}
+LIB_OBJS= ${LIB_SRCS:R:S/$/.o/}
+
+.PHONY: all
+.PHONY: generate_sources
+.PHONY: libgnat_util.a
+.PHONY: install
+.PHONY: clean
+
+all: libgnat_util.a
+
+generate_sources:
+ (cd ${.CURDIR} && ${MKDIR} ${SRC} lib)
+ ${CP} ${.CURDIR}/sdefault_adb.gnat_util ${.CURDIR}/${SRC}/sdefault.adb
+ (cd ${.CURDIR} && ${CP} \
+ xsnamest.adb xutil.* snames.adb-tmpl snames.ads-tmpl \
+ snames.h-tmpl ${SRC})
+ (cd ${.CURDIR}/${SRC} && \
+ gnatmake -gnatf -gnatwae -gnatyg -gnatyS xsnamest && \
+ ./xsnamest && mv snames.ns snames.ads && mv snames.nb snames.adb)
+
+${LIB_OBJS}: generate_sources
+
+install:
+ ${MKDIR} ${DESTDIR}${PREFIX}/lib/gnat
+ ${MKDIR} ${DESTDIR}${PREFIX}/lib/gnat_util
+ ${MKDIR} ${DESTDIR}${PREFIX}/include/gnat_util
+
+ ${BSD_INSTALL_DATA} ../gnat_util.gpr ${DESTDIR}${PREFIX}/lib/gnat
+ find ../lib -type f -exec $(BSD_INSTALL_DATA) {} \
+ ${DESTDIR}${PREFIX}/lib/gnat_util \;
+ find ../* -name \*\.ad\[bs\] -exec $(BSD_INSTALL_DATA) {} \
+ ${DESTDIR}${PREFIX}/include/gnat_util \;
+
+clean:
+ rm -f ${.OBJDIR}/*
+ rm -f ${.CURDIR}/lib/*
+ rm -rf ${.CURDIR}/${SRC}
+
+.SUFFIXES: .adb .ads .c .o
+
+.adb.o:
+ ada ${ADA_FLAGS} -I../ -I../${SRC} -c ../${.TARGET:R}.adb
+
+.c.o:
+ ${CC} ${C_FLAGS} -c ../${.TARGET:R}.c
+
+${ADS_SRCS:R:S/$/.o/}:
+ ada ${ADA_FLAGS} -I../${SRC} -c ../${.TARGET:R}.ads
+
+${GEN_SRCS:R:S/$/.o/}:
+ ada ${ADA_FLAGS} -I../ -c ../${SRC}/${.TARGET:R}.adb
+
+libgnat_util.a: ${LIB_OBJS}
+ ar cq ${.TARGET} `lorder ${LIB_OBJS} | tsort -q`
+ ranlib ${.TARGET}
+ mv ${.TARGET} *.ali ../lib