[375a068] | 1 | ######################## -*- Mode: Makefile-Automake -*- ###################### |
---|
| 2 | ## |
---|
| 3 | ## Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo |
---|
| 4 | ## |
---|
| 5 | ## The contents of this file are covered under the licence agreement in the |
---|
| 6 | ## file "LICENCE" distributed with Cforall. |
---|
| 7 | ## |
---|
| 8 | ## Makefile.am -- |
---|
| 9 | ## |
---|
| 10 | ## Author : Peter A. Buhr |
---|
| 11 | ## Created On : Sun May 31 08:54:01 2015 |
---|
| 12 | ## Last Modified By : Peter A. Buhr |
---|
[fb64e86] | 13 | ## Last Modified On : Mon Feb 3 21:27:18 2020 |
---|
| 14 | ## Update Count : 208 |
---|
[375a068] | 15 | ############################################################################### |
---|
| 16 | |
---|
| 17 | # create object files in directory with source files |
---|
[0c1b566] | 18 | AUTOMAKE_OPTIONS = foreign subdir-objects |
---|
[2fbc904] | 19 | ACLOCAL_AMFLAGS = -I automake |
---|
[375a068] | 20 | |
---|
| 21 | # put into lib for now |
---|
[088a5cd] | 22 | cfalibdir = ${CFA_LIBDIR} |
---|
[c680a4b] | 23 | cfalib_DATA = gcc-builtins.cf builtins.cf extras.cf prelude.cfa bootloader.c defines.hfa |
---|
[375a068] | 24 | |
---|
[b7fe2e6] | 25 | EXTRA_DIST = bootloader.cf builtins.c builtins.def extras.c extras.regx extras.regx2 prelude-gen.cc prototypes.awk prototypes.c prototypes.sed sync-builtins.cf |
---|
| 26 | |
---|
[bbfd0e0] | 27 | CC = @LOCAL_CFACC@ |
---|
[38d12e7] | 28 | AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@ |
---|
[575a6e5] | 29 | AM_CFAFLAGS = @CONFIG_CFAFLAGS@ |
---|
[307a732] | 30 | |
---|
[8c680e9] | 31 | $(DEPDIR) : |
---|
| 32 | mkdir $(DEPDIR) |
---|
| 33 | |
---|
| 34 | $(DEPDIR)/builtins.Po : $(DEPDIR) |
---|
| 35 | touch ${@} |
---|
| 36 | |
---|
[375a068] | 37 | # create extra forward types/declarations to reduce inclusion of library files |
---|
[e9546f9] | 38 | extras.cf : ${srcdir}/extras.regx ${srcdir}/extras.c |
---|
[37fe352] | 39 | ${AM_V_GEN}gcc ${AM_CFLAGS} -E ${srcdir}/extras.c | grep -f ${srcdir}/extras.regx > extras.cf |
---|
[fb64e86] | 40 | ${AM_V_GEN}gcc ${AM_CFLAGS} -E ${srcdir}/extras.c | grep -zo -f ${srcdir}/extras.regx2 | tr '\0' '\n' >> extras.cf |
---|
[375a068] | 41 | |
---|
| 42 | # create forward declarations for gcc builtins |
---|
[e9546f9] | 43 | gcc-builtins.cf : gcc-builtins.c ${srcdir}/prototypes.sed |
---|
[ff1e0f38] | 44 | ${AM_V_GEN}gcc -I${srcdir} -E -P $< | sed -r -f ${srcdir}/prototypes.sed > $@ |
---|
[375a068] | 45 | |
---|
[e9546f9] | 46 | gcc-builtins.c : ${srcdir}/builtins.def ${srcdir}/prototypes.awk ${srcdir}/sync-builtins.cf ${srcdir}/prototypes.c |
---|
[ff1e0f38] | 47 | ${AM_V_GEN}gcc -I${srcdir} -E ${srcdir}/prototypes.c | awk -f ${srcdir}/prototypes.awk > $@ |
---|
[375a068] | 48 | |
---|
[e523b07] | 49 | prelude.cfa : prelude-gen.cc |
---|
[37fe352] | 50 | ${AM_V_GEN}${CXX} ${AM_CXXFLAGS} ${CXXFLAGS} ${AM_CFLAGS} ${<} -o prelude-gen -Wall -Wextra -O2 -g -std=c++14 |
---|
[1d386a7] | 51 | @./prelude-gen > $@ |
---|
| 52 | @rm ./prelude-gen |
---|
| 53 | |
---|
[375a068] | 54 | builtins.def : |
---|
| 55 | |
---|
| 56 | prototypes.awk : |
---|
| 57 | |
---|
[807ce84] | 58 | # create forward declarations for cfa builtins |
---|
[bbfd0e0] | 59 | builtins.cf : builtins.c @LOCAL_CFACC@ |
---|
[42655e8] | 60 | ${AM_V_GEN}gcc ${AM_CFLAGS} -E -P ${<} -o ${@} -MD -MP -MF $(DEPDIR)/builtins.Po -D__cforall |
---|
[8c680e9] | 61 | ${AM_V_at}sed -i 's/builtins.o/builtins.cf/g' $(DEPDIR)/builtins.Po |
---|
| 62 | |
---|
| 63 | include $(DEPDIR)/builtins.Po |
---|
[807ce84] | 64 | |
---|
[14347ac] | 65 | bootloader.c : ${srcdir}/bootloader.cf prelude.cfa extras.cf gcc-builtins.cf builtins.cf @CFACPP@ |
---|
| 66 | ${AM_V_GEN}@CFACPP@ --prelude-dir=${builddir} -tpm ${srcdir}/bootloader.cf $@ # use src/cfa-cpp as not in lib until after install |
---|
[375a068] | 67 | |
---|
[8c680e9] | 68 | maintainer-clean-local : |
---|
| 69 | rm -rf $(DEPDIR) |
---|
| 70 | |
---|
[e523b07] | 71 | MOSTLYCLEANFILES = bootloader.c builtins.cf extras.cf gcc-builtins.c gcc-builtins.cf prelude.cfa |
---|
[2a59655] | 72 | DISTCLEANFILES = $(DEPDIR)/builtins.Po |
---|
[37fe352] | 73 | MAINTAINERCLEANFILES = ${addprefix ${libdir}/,${cfalib_DATA}} ${addprefix ${libdir}/,${lib_LIBRARIES}} |
---|
[bbfd0e0] | 74 | |
---|
| 75 | if ENABLE_DISTCC |
---|
[81e60f7] | 76 | distribution: @LOCAL_CFACC@ @LOCAL_CC1@ @CFACPP@ gcc-builtins.cf builtins.cf extras.cf prelude.cfa bootloader.c $(srcdir)/../../tools/build/push2dist.sh |
---|
[7c6b262] | 77 | ${AM_V_GEN}$(srcdir)/../../tools/build/push2dist.sh @CFADIR_HASH@ @DIST_BWLIMIT@ |
---|
[1ee048fd] | 78 | @echo "Dummy file to track distribution to remote hosts" > ${@} |
---|
[bbfd0e0] | 79 | |
---|
| 80 | all: all-am distribution |
---|
[fb64e86] | 81 | endif ENABLE_DISTCC |
---|