| 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 09:08:15 2015
|
|---|
| 12 | ## Last Modified By : Peter A. Buhr
|
|---|
| 13 | ## Last Modified On : Wed Jun 6 16:42:20 2018
|
|---|
| 14 | ## Update Count : 49
|
|---|
| 15 | ###############################################################################
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 | debug=yes
|
|---|
| 19 |
|
|---|
| 20 | quick_test=avl_test operators numericConstants expression enum array typeof cast raii/dtor-early-exit raii/init_once attributes
|
|---|
| 21 |
|
|---|
| 22 | if BUILD_CONCURRENCY
|
|---|
| 23 | concurrent=
|
|---|
| 24 | else
|
|---|
| 25 | concurrent='-Econcurrent'
|
|---|
| 26 | endif
|
|---|
| 27 |
|
|---|
| 28 | TEST_PY = python ${srcdir}/test.py
|
|---|
| 29 |
|
|---|
| 30 | # applies to both programs
|
|---|
| 31 | AM_CFLAGS = $(if $(test), 2> $(test), ) \
|
|---|
| 32 | -g \
|
|---|
| 33 | -Wall \
|
|---|
| 34 | -Wno-unused-function \
|
|---|
| 35 | -quiet @CFA_FLAGS@ \
|
|---|
| 36 | -DIN_DIR="${srcdir}/.in/" \
|
|---|
| 37 | @BUILD_IN_TREE_FLAGS@
|
|---|
| 38 |
|
|---|
| 39 | if !BUILD_DEBUG
|
|---|
| 40 | AM_CFLAGS += -nodebug
|
|---|
| 41 | else
|
|---|
| 42 | if !BUILD_RELEASE
|
|---|
| 43 | AM_CFLAGS += -debug
|
|---|
| 44 | else
|
|---|
| 45 | AM_CFLAGS += ${DEBUG_FLAGS}
|
|---|
| 46 | endif
|
|---|
| 47 | endif
|
|---|
| 48 |
|
|---|
| 49 | CC = @CFACC@
|
|---|
| 50 |
|
|---|
| 51 | .PHONY : list
|
|---|
| 52 | EXTRA_PROGRAMS = fstream_test avl_test # build but do not install
|
|---|
| 53 |
|
|---|
| 54 | fstream_test_SOURCES = fstream_test.c
|
|---|
| 55 |
|
|---|
| 56 | avl_test_SOURCES = avltree/avl_test.c avltree/avl0.c avltree/avl1.c avltree/avl2.c avltree/avl3.c avltree/avl4.c avltree/avl-private.c
|
|---|
| 57 |
|
|---|
| 58 | all-local :
|
|---|
| 59 | @+${TEST_PY} --debug=${debug} ${concurrent} ${quick_test}
|
|---|
| 60 |
|
|---|
| 61 | all-tests :
|
|---|
| 62 | @+${TEST_PY} --all --debug=${debug} ${concurrent} # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
|
|---|
| 63 |
|
|---|
| 64 | clean-local :
|
|---|
| 65 | rm -f ${EXTRA_PROGRAMS}
|
|---|
| 66 |
|
|---|
| 67 | list :
|
|---|
| 68 | @+${TEST_PY} --list ${concurrent}
|
|---|
| 69 |
|
|---|
| 70 | concurrency :
|
|---|
| 71 | @+${TEST_PY} --debug=${debug} -Iconcurrent
|
|---|
| 72 |
|
|---|
| 73 | # SKULLDUGGERY like libcfa/Makefile.am prevent extensionless headers from being generated
|
|---|
| 74 | # however, here it is more complicated because it must match the dependencies based on how
|
|---|
| 75 | # they are generated by gcc
|
|---|
| 76 | headers = $(shell find $(top_srcdir)/src/libcfa -type f ! -name "*.*")
|
|---|
| 77 | headers_real = $(shell realpath --relative-to=$(top_srcdir)/src/libcfa $(headers))
|
|---|
| 78 | headers_deps = $(addprefix %/, $(headers_real))
|
|---|
| 79 | $(headers_deps) :
|
|---|
| 80 | echo "Dummy rule, should never be called"
|
|---|
| 81 |
|
|---|
| 82 | # %/stdlib:
|
|---|
| 83 | # echo "Dummy rule, should never be called"
|
|---|
| 84 |
|
|---|
| 85 | # implicit rule so not all test require a rule
|
|---|
| 86 | % : %.c $(CC)
|
|---|
| 87 | $(COMPILE) $(abspath ${<}) -o ${@}
|
|---|
| 88 |
|
|---|
| 89 | declarationSpecifier: declarationSpecifier.c $(CC)
|
|---|
| 90 | $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
|
|---|
| 91 |
|
|---|
| 92 | gccExtensions : gccExtensions.c $(CC)
|
|---|
| 93 | $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
|
|---|
| 94 |
|
|---|
| 95 | extension : extension.c $(CC)
|
|---|
| 96 | $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
|
|---|
| 97 |
|
|---|
| 98 | attributes : attributes.c $(CC)
|
|---|
| 99 | $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
|
|---|
| 100 |
|
|---|
| 101 | functions: functions.c $(CC)
|
|---|
| 102 | $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
|
|---|
| 103 |
|
|---|
| 104 | KRfunctions : KRfunctions.c $(CC)
|
|---|
| 105 | $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
|
|---|
| 106 |
|
|---|
| 107 | sched-ext-parse : sched-ext-parse.c $(CC)
|
|---|
| 108 | $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
|
|---|
| 109 |
|
|---|
| 110 | gmp : gmp.c $(CC)
|
|---|
| 111 | $(COMPILE) -lgmp $(abspath ${<}) -o ${@}
|
|---|
| 112 |
|
|---|
| 113 | completeTypeError : completeTypeError.c $(CC)
|
|---|
| 114 | $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
|
|---|
| 115 |
|
|---|
| 116 | typedefRedef-ERR1: typedefRedef.c $(CC)
|
|---|
| 117 | $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
|
|---|
| 118 |
|
|---|
| 119 | alloc-ERROR: alloc.c $(CC)
|
|---|
| 120 | $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
|
|---|
| 121 |
|
|---|
| 122 | fallthrough-ERROR: fallthrough.c $(CC)
|
|---|
| 123 | $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
|
|---|
| 124 |
|
|---|
| 125 | nested-types-ERR1: nested-types.c $(CC)
|
|---|
| 126 | $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
|
|---|
| 127 |
|
|---|
| 128 | nested-types-ERR2: nested-types.c $(CC)
|
|---|
| 129 | $(COMPILE) -DERR2 $(abspath ${<}) -o ${@}
|
|---|
| 130 |
|
|---|
| 131 | # Constructor/destructor tests
|
|---|
| 132 | raii/dtor-early-exit-ERR1: raii/dtor-early-exit.c $(CC)
|
|---|
| 133 | $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
|
|---|
| 134 |
|
|---|
| 135 | raii/dtor-early-exit-ERR2: raii/dtor-early-exit.c $(CC)
|
|---|
| 136 | $(COMPILE) -DERR2 $(abspath ${<}) -o ${@}
|
|---|
| 137 |
|
|---|
| 138 | raii/memberCtors-ERR1: raii/memberCtors.c $(CC)
|
|---|
| 139 | $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
|
|---|
| 140 |
|
|---|
| 141 | raii/ctor-autogen-ERR1: raii/ctor-autogen.c $(CC)
|
|---|
| 142 | $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
|
|---|
| 143 |
|
|---|
| 144 | # Warnings
|
|---|
| 145 | warnings/self-assignment: warnings/self-assignment.c $(CC)
|
|---|
| 146 | $(COMPILE) $(abspath ${<}) 2> ${@} -fsyntax-only
|
|---|
| 147 |
|
|---|
| 148 | #builtins
|
|---|
| 149 | builtins/sync: builtins/sync.c $(CC)
|
|---|
| 150 | $(COMPILE) $(abspath ${<}) 2> ${@} -fsyntax-only
|
|---|