| [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
 | 
|---|
| [b3ad342] | 13 | ## Last Modified On : Sat Feb 15 12:17:19 2025
 | 
|---|
 | 14 | ## Update Count     : 233
 | 
|---|
| [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}
 | 
|---|
| [be3f163] | 23 | cfalib_DATA = gcc-builtins.cfa builtins.cfa extras.cfa prelude.cfa bootloader.c defines.hfa
 | 
|---|
| [375a068] | 24 | 
 | 
|---|
| [be3f163] | 25 | EXTRA_DIST = bootloader.cfa builtins.c builtins.def extras.c extras.regx extras.regx2 prelude-gen.cc prototypes.awk prototypes.c prototypes.sed sync-builtins.cfa
 | 
|---|
| [b7fe2e6] | 26 | 
 | 
|---|
| [bbfd0e0] | 27 | CC = @LOCAL_CFACC@
 | 
|---|
| [850aff1] | 28 | AM_CFLAGS = -g -Wall -Werror=return-type -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
 | 
|---|
| [be3f163] | 38 | extras.cfa : ${srcdir}/extras.regx ${srcdir}/extras.c
 | 
|---|
| [f520c4c] | 39 |         @echo '# 2 "${@}"  // needed for error messages from this file' > ${@}
 | 
|---|
| [e0ac9f1] | 40 |         ${AM_V_GEN}gcc ${AM_CFLAGS} -E ${srcdir}/extras.c | grep -f ${srcdir}/extras.regx >> ${@}
 | 
|---|
 | 41 |         ${AM_V_GEN}gcc ${AM_CFLAGS} -E ${srcdir}/extras.c | grep -zo -f ${srcdir}/extras.regx2 | tr '\0' '\n' >> ${@}
 | 
|---|
| [375a068] | 42 | 
 | 
|---|
 | 43 | # create forward declarations for gcc builtins
 | 
|---|
| [be3f163] | 44 | gcc-builtins.cfa : gcc-builtins.c ${srcdir}/prototypes.sed
 | 
|---|
| [f520c4c] | 45 |         @echo '# 2 "${@}"  // needed for error messages from this file' > ${@}
 | 
|---|
| [e0ac9f1] | 46 |         ${AM_V_GEN}gcc -I${srcdir} -E -P $< | sed -r -f ${srcdir}/prototypes.sed >> ${@}
 | 
|---|
| [375a068] | 47 | 
 | 
|---|
| [be3f163] | 48 | gcc-builtins.c : ${srcdir}/builtins.def ${srcdir}/prototypes.awk ${srcdir}/sync-builtins.cfa ${srcdir}/prototypes.c
 | 
|---|
| [b3ad342] | 49 |         ${AM_V_GEN}gcc -I${srcdir} -E ${srcdir}/prototypes.c | awk -v wordsize="${AM_CFLAGS}" -f ${srcdir}/prototypes.awk > ${@}
 | 
|---|
| [375a068] | 50 | 
 | 
|---|
| [e523b07] | 51 | prelude.cfa : prelude-gen.cc
 | 
|---|
| [3acc863] | 52 |         ${AM_V_GEN}${CXX} ${AM_CXXFLAGS} ${CXXFLAGS} ${AM_CFLAGS} ${<} -o prelude-gen -Wall -Wextra -O2 -g -std=c++17
 | 
|---|
| [e0ac9f1] | 53 |         @./prelude-gen > ${@}
 | 
|---|
| [1d386a7] | 54 |         @rm ./prelude-gen
 | 
|---|
 | 55 | 
 | 
|---|
| [375a068] | 56 | builtins.def :
 | 
|---|
 | 57 | 
 | 
|---|
 | 58 | prototypes.awk :
 | 
|---|
 | 59 | 
 | 
|---|
| [807ce84] | 60 | # create forward declarations for cfa builtins
 | 
|---|
| [be3f163] | 61 | builtins.cfa : builtins.c @LOCAL_CFACC@
 | 
|---|
| [f520c4c] | 62 |         ${AM_V_GEN}gcc ${AM_CFLAGS} -E ${<} -o ${@} -MD -MP -MF $(DEPDIR)/builtins.Po -D__cforall
 | 
|---|
| [be3f163] | 63 |         ${AM_V_at}sed -i 's/builtins.o/builtins.cfa/g' $(DEPDIR)/builtins.Po
 | 
|---|
| [8c680e9] | 64 | 
 | 
|---|
 | 65 | include $(DEPDIR)/builtins.Po
 | 
|---|
| [807ce84] | 66 | 
 | 
|---|
| [be3f163] | 67 | bootloader.c : ${srcdir}/bootloader.cfa prelude.cfa extras.cfa gcc-builtins.cfa builtins.cfa @CFACPP@
 | 
|---|
 | 68 |         ${AM_V_GEN}@CFACPP@ --prelude-dir=${builddir} -tpm ${srcdir}/bootloader.cfa ${@}  # use src/cfa-cpp as not in lib until after install
 | 
|---|
| [375a068] | 69 | 
 | 
|---|
| [8c680e9] | 70 | maintainer-clean-local :
 | 
|---|
 | 71 |         rm -rf $(DEPDIR)
 | 
|---|
 | 72 | 
 | 
|---|
| [be3f163] | 73 | MOSTLYCLEANFILES = bootloader.c builtins.cfa extras.cfa gcc-builtins.c gcc-builtins.cfa prelude.cfa
 | 
|---|
| [2a59655] | 74 | DISTCLEANFILES = $(DEPDIR)/builtins.Po
 | 
|---|
| [37fe352] | 75 | MAINTAINERCLEANFILES = ${addprefix ${libdir}/,${cfalib_DATA}} ${addprefix ${libdir}/,${lib_LIBRARIES}}
 | 
|---|
| [bbfd0e0] | 76 | 
 | 
|---|
 | 77 | if ENABLE_DISTCC
 | 
|---|
| [be3f163] | 78 | distribution: @LOCAL_CFACC@ @LOCAL_CC1@ @CFACPP@ defines.hfa gcc-builtins.cfa builtins.cfa extras.cfa prelude.cfa bootloader.c $(srcdir)/../../tools/build/push2dist.sh
 | 
|---|
| [7c6b262] | 79 |         ${AM_V_GEN}$(srcdir)/../../tools/build/push2dist.sh @CFADIR_HASH@ @DIST_BWLIMIT@
 | 
|---|
| [1ee048fd] | 80 |         @echo "Dummy file to track distribution to remote hosts" > ${@}
 | 
|---|
| [bbfd0e0] | 81 | 
 | 
|---|
 | 82 | all: all-am distribution
 | 
|---|
| [fb64e86] | 83 | endif ENABLE_DISTCC
 | 
|---|