[00cc023] | 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 | ## |
---|
[d63eeb0] | 8 | ## Makefile.am -- |
---|
[00cc023] | 9 | ## |
---|
| 10 | ## Author : Peter A. Buhr |
---|
| 11 | ## Created On : Sun May 31 08:54:01 2015 |
---|
| 12 | ## Last Modified By : Peter A. Buhr |
---|
[6d665d9] | 13 | ## Last Modified On : Fri Aug 26 12:03:37 2016 |
---|
| 14 | ## Update Count : 199 |
---|
[00cc023] | 15 | ############################################################################### |
---|
| 16 | |
---|
[a922e34] | 17 | # create object files in directory with source files |
---|
| 18 | AUTOMAKE_OPTIONS = subdir-objects |
---|
| 19 | |
---|
[00cc023] | 20 | lib_LIBRARIES = libcfa.a |
---|
| 21 | |
---|
| 22 | # put into lib for now |
---|
| 23 | cfalibdir = ${libdir} |
---|
[159c62e] | 24 | cfalib_DATA = builtins.cf extras.cf prelude.cf |
---|
[00cc023] | 25 | |
---|
[a922e34] | 26 | # create extra forward types/declarations to reduce inclusion of library files |
---|
[159c62e] | 27 | extras.cf : extras.regx extras.c |
---|
[d0542c4] | 28 | ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -E ${srcdir}/extras.c | grep -f extras.regx > ${srcdir}/extras.cf |
---|
[00cc023] | 29 | |
---|
[a922e34] | 30 | # create forward declarations for gcc builtins |
---|
[00cc023] | 31 | builtins.cf : builtins.c |
---|
[d0542c4] | 32 | ${AM_V_GEN}if [ -e $< ] ; then \ |
---|
[00cc023] | 33 | @BACKEND_CC@ -E -P $^ | sed -e "/targetm/s/.*//" -e "/_Decimal/s/.*//" -e "s/void (const char \*)0();//" -e "s/\"//g" -e "s/\(__builtin_\) /\1/" > $@ ; \ |
---|
| 34 | fi |
---|
| 35 | |
---|
| 36 | builtins.c : builtins.def prototypes.awk |
---|
[d0542c4] | 37 | ${AM_V_GEN}if [ -e $< ] ; then \ |
---|
[00cc023] | 38 | @BACKEND_CC@ -E prototypes.c | awk -f prototypes.awk > $@ ; \ |
---|
| 39 | fi |
---|
| 40 | |
---|
| 41 | builtins.def : |
---|
| 42 | |
---|
[db82596] | 43 | prototypes.awk : |
---|
| 44 | |
---|
[159c62e] | 45 | MAINTAINERCLEANFILES = builtins.cf extras.cf ${addprefix ${libdir}/,${cfalib_DATA}} ${addprefix ${libdir}/,${lib_LIBRARIES}} |
---|
[d3b7937] | 46 | |
---|
| 47 | #-------------------------------------------------- |
---|
[aa30dc0] | 48 | |
---|
[159c62e] | 49 | libcfa-prelude.c : ${srcdir}/prelude.cf ${srcdir}/extras.cf ${srcdir}/builtins.cf |
---|
[d0542c4] | 50 | ${AM_V_GEN}${abs_top_srcdir}/src/driver/cfa-cpp -l ${srcdir}/prelude.cf $@ # use src/cfa-cpp as not in lib until after install |
---|
[00cc023] | 51 | |
---|
| 52 | libcfa-prelude.o : libcfa-prelude.c |
---|
[d0542c4] | 53 | ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -c -o $@ $< |
---|
[d3b7937] | 54 | |
---|
[d7bcbf5] | 55 | EXTRA_FLAGS = \ |
---|
[8e5724e] | 56 | -g \ |
---|
| 57 | -Wall \ |
---|
| 58 | -Wno-unused-function \ |
---|
| 59 | @CFA_FLAGS@ \ |
---|
| 60 | -I${abs_top_srcdir}/src/libcfa/libhdr \ |
---|
| 61 | # TEMPORARY: does not build with -O2 |
---|
[d7bcbf5] | 62 | |
---|
[e4745d7a] | 63 | AM_CCASFLAGS = @CFA_FLAGS@ |
---|
[d7bcbf5] | 64 | CFLAGS = ${EXTRA_FLAGS} -quiet -no-include-stdhdr -XCFA -t -B${abs_top_srcdir}/src/driver |
---|
[d63eeb0] | 65 | CC = ${abs_top_srcdir}/src/driver/cfa |
---|
[d3b7937] | 66 | |
---|
[f773f67] | 67 | headers = limits stdlib math iostream fstream iterator rational assert containers/vector concurrency/threads |
---|
[0e76cf4f] | 68 | runtimehdrs = concurrency |
---|
[89ce869] | 69 | libobjs = ${headers:=.o} |
---|
[ac78e25] | 70 | |
---|
[89ce869] | 71 | # extensionless header files are overridden by -o flag in default makerule => explicitly override default rule to silently do nothing |
---|
| 72 | % : %.c |
---|
| 73 | @true |
---|
[ac78e25] | 74 | |
---|
[d7bcbf5] | 75 | concurrency/invoke.o : concurrency/invoke.c |
---|
[c5cb6130] | 76 | $(AM_V_CC) @BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. ${EXTRA_FLAGS} -c -o $@ $< |
---|
[d7bcbf5] | 77 | |
---|
[d0542c4] | 78 | ${libobjs} : ${abs_top_srcdir}/src/driver/cfa-cpp ${cfalib_DATA} # add dependency to cfa-cpp so all libraries are rebuilt with new translator |
---|
[d3b7937] | 79 | |
---|
[e4745d7a] | 80 | libcfa_a_SOURCES = libcfa-prelude.c ${headers:=.c} concurrency/CtxSwitch-@MACHINE_TYPE@.S concurrency/invoke.c |
---|
[bd85400] | 81 | |
---|
[ed0e67a] | 82 | stdhdr = ${shell echo stdhdr/*} |
---|
| 83 | |
---|
| 84 | nobase_include_HEADERS = ${headers} ${stdhdr} |
---|
[d3b7937] | 85 | |
---|
[f326f99] | 86 | CLEANFILES = libcfa-prelude.c |
---|
[159c62e] | 87 | |
---|
| 88 | maintainer-clean-local: |
---|
| 89 | -rm -rf ${includedir}/* |
---|