Changeset 4daf79f


Ignore:
Timestamp:
May 1, 2023, 4:59:07 PM (10 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, master
Children:
c083c3d
Parents:
985b624
Message:

formatting, adjust target names for Makefiles

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Makefile.am

    r985b624 r4daf79f  
    1111## Created On       : Sun May 31 22:14:18 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Sat Feb  2 16:54:42 2019
    14 ## Update Count     : 21
     13## Last Modified On : Mon May  1 16:38:04 2023
     14## Update Count     : 32
    1515###############################################################################
     16
     17# user targets:
     18#  Compile compiler/runtime and run test suite.
     19#  $ make check / tests [debug=yes/no] [installed=yes/no] [arch=x86/x64/arm]
     20
     21#  $ make installcheck [debug=yes/no] installed=yes [arch=x86/x64/arm]
    1622
    1723AUTOMAKE_OPTIONS = foreign    # do not require all the GNU file names
     
    3743EXTRA_DIST = LICENSE doc/man/cfa.1 libcfa/configure libcfa/Makefile.dist.am libcfa/Makefile.dist.in tools/build/distcc_hash tools/build/push2dist.sh
    3844
    39 debug=yes
     45debug ?= yes
     46installed ?= no
     47ARCH = $(if $(arch),"arch=$(arch)")
     48
    4049check:
    41         $(MAKE) -C tests all-tests installed=no debug=${debug}
     50        $(MAKE) -C tests tests installed=$(installed) debug=$(debug) $(ARCH)
     51
     52tests: check # synonym
    4253
    4354installcheck:
    44         $(MAKE) -C tests all-tests installed=yes debug=${debug}
     55        $(MAKE) -C tests tests installed=yes debug=$(debug) $(ARCH)
    4556
    4657configure-libcfa: @LIBCFA_TARGET_MAKEFILES@
  • tests/Makefile.am

    r985b624 r4daf79f  
    1111## Created On       : Sun May 31 09:08:15 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Mon Apr 10 23:24:02 2023
    14 ## Update Count     : 96
     13## Last Modified On : Mon May  1 16:45:07 2023
     14## Update Count     : 144
    1515###############################################################################
     16
     17# user targets:
     18#  Run the complete test suite.
     19#  $ make  / tests [debug=yes/no] [installed=yes/no] [arch=x86/x64/arm]
     20
     21#  Run the short (quick) test suite.
     22#  $ make quick [debug=yes/no] [installed=yes/no] [arch=x86/x64/arm]
    1623
    1724AUTOMAKE_OPTIONS = foreign    # do not require all the GNU file names
     
    2027include $(top_srcdir)/tools/build/cfa.make
    2128
    22 DEFAULT_INCLUDES = -I${abs_srcdir}
    23 
    24 debug=yes
    25 installed=no
     29DEFAULT_INCLUDES = -I$(abs_srcdir)
     30
     31debug ?= yes
     32installed ?= no
     33ARCH=$(if $(arch),"--arch=$(arch)")
    2634archiveerrors=
    2735
     
    3341timeouts=
    3442
    35 TEST_PY = python3 ${builddir}/test.py
     43TEST_PY = python3 $(builddir)/test.py
    3644
    3745# applies to both programs
    3846# since automake doesn't have support for CFA we have to
    3947AM_CFLAGS = $(if $(test), 2> $(test), ) \
    40         -fdebug-prefix-map=$(abspath ${abs_srcdir})= \
     48        -fdebug-prefix-map=$(abspath $(abs_srcdir))= \
    4149        -fdebug-prefix-map=/tmp= \
    4250        -fno-diagnostics-show-caret \
     
    5462
    5563# adjust CC to current flags
    56 CC = LC_ALL=C $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) ${ARCH_FLAGS} ,$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
     64CC = LC_ALL=C $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) $(ARCH_FLAGS) ,$(TARGET_CFA) $(DEBUG_FLAGS) $(ARCH_FLAGS))
    5765CFACC = $(CC)
    5866
     
    6169
    6270# adjusted CC but without the actual distcc call
    63 CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) ${ARCH_FLAGS} ,$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
    64 CFACCLINK = $(CFACCLOCAL) -quiet $(if $(test), 2> $(test), ) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'))
    65 
    66 PRETTY_PATH=mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
     71CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) $(ARCH_FLAGS) ,$(TARGET_CFA) $(DEBUG_FLAGS) $(ARCH_FLAGS))
     72CFACCLINK = $(CFACCLOCAL) -quiet $(if $(test), 2> $(test), ) $($(shell echo "$(@)_FLAGSLD" | sed 's/-\|\//_/g'))
     73
     74PRETTY_PATH=mkdir -p $(dir $(abspath $(@))) && cd $(srcdir) &&
    6775
    6876.PHONY: list .validate .test_makeflags
     
    93101dist-hook:
    94102        echo "Gathering test files"
    95         for file in `${TEST_PY} --list-dist`; do \
    96                 if test -f ${srcdir}/$${file}; then \
    97                         $(MKDIR_P) $$(dirname ${distdir}/$${file}); \
    98                         cp -df ${srcdir}/$${file} ${distdir}/$${file}; \
     103        for file in `$(TEST_PY) --list-dist`; do \
     104                if test -f $(srcdir)/$$(file); then \
     105                        $(MKDIR_P) $$(dirname $(distdir)/$$(file)); \
     106                        cp -df $(srcdir)/$$(file) $(distdir)/$$(file); \
    99107                fi; \
    100108        done
     
    107115
    108116#----------------------------------------------------------------------------------------------------------------
     117
    109118all-local :
    110         @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${quick_test}
    111 
    112 all-tests :
    113         @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
     119        @+$(TEST_PY) --debug=$(debug) --install=$(installed) --archive-errors=$(archiveerrors) $(concurrent) $(timeouts) $(ARCH) --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
     120
     121install : all-local # PAB only
     122
     123tests : all-local
     124
     125quick :
     126        @+$(TEST_PY) --debug=$(debug) --install=$(installed) --archive-errors=$(archiveerrors) $(concurrent) $(timeouts) $(ARCH) $(quick_test)
    114127
    115128mostlyclean-local :
    116         find ${builddir} -not -path './__pycache__/*' -path '*.o' -delete
    117         find ${builddir} -not -path './__pycache__/*' -path '*/.err/*.log' -delete
    118         find ${builddir} -not -path './__pycache__/*' -path '*/.out/*.log' -delete
    119         rm -f ${EXTRA_PROGRAMS}
     129        find $(builddir) -not -path './__pycache__/*' -path '*.o' -delete
     130        find $(builddir) -not -path './__pycache__/*' -path '*/.err/*.log' -delete
     131        find $(builddir) -not -path './__pycache__/*' -path '*/.out/*.log' -delete
     132        rm -f $(EXTRA_PROGRAMS)
    120133        rm -rf __pycache__
    121134
    122135distclean-local :
    123         find ${builddir} -path '*.Po' -delete
     136        find $(builddir) -path '*.Po' -delete
    124137
    125138list :
    126         @+${TEST_PY} --list ${concurrent}
     139        @+$(TEST_PY) --list $(concurrent)
    127140
    128141.test_makeflags:
    129         @echo "${MAKEFLAGS}"
     142        @echo "$(MAKEFLAGS)"
    130143
    131144.validate: .validate.cfa
     
    133146
    134147.validate.cfa:
    135         @echo "int main() { return 0; }" > ${@}
     148        @echo "int main() { return 0; }" > $(@)
    136149
    137150# automake doesn't know we still need C rules so pretend like we have a C program
    138151.dummy_hack.c:
    139         @echo "int main() { return 0; }" > ${@}
     152        @echo "int main() { return 0; }" > $(@)
    140153
    141154.dummy_hackxx.cpp:
    142         @echo "int bar() { return 0; }" > ${@}
     155        @echo "int bar() { return 0; }" > $(@)
    143156
    144157concurrency :
    145         @+${TEST_PY} --debug=${debug}  --install=${installed} -Iconcurrent
     158        @+$(TEST_PY) --debug=$(debug)  --install=$(installed) -Iconcurrent
    146159
    147160#----------------------------------------------------------------------------------------------------------------
    148161
    149162# Use for all tests, make sure the path are correct and all flags are added
    150 CFACOMPILETEST=$(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) $($(shell echo "${@}_FLAGSCFA" | sed 's/-\|\//_/g'))
     163CFACOMPILETEST=$(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=$(srcdir) $(<)) $($(shell echo "$(@)_FLAGSCFA" | sed 's/-\|\//_/g'))
    151164
    152165#----------------------------------------------------------------------------------------------------------------
     
    156169# don't use distcc to do the linking because distcc doesn't do linking
    157170% : %.cfa $(CFACCBIN)
    158         $(CFACOMPILETEST) -c -o $(abspath ${@}).o -DIN_DIR="$(abspath $(dir ${<}))/.in/"
    159         $(CFACCLINK) ${@}.o -o $(abspath ${@})
    160         rm $(abspath ${@}).o
     171        $(CFACOMPILETEST) -c -o $(abspath $(@)).o -DIN_DIR="$(abspath $(dir $(<)))/.in/"
     172        $(CFACCLINK) $(@).o -o $(abspath $(@))
     173        rm $(abspath $(@)).o
    161174
    162175# implicit rule for c++ test
    163176# convient for testing the testsuite itself but not actuall used
    164177% : %.cpp
    165         $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     178        $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=$(srcdir) $(<)) -o $(abspath $(@))
    166179
    167180#------------------------------------------------------------------------------
     
    175188GENERATED_CODE = declarationSpecifier gccExtensions extension attributes functions KRfunctions
    176189$(GENERATED_CODE): % : %.cfa $(CFACCBIN)
    177         $(CFACOMPILETEST) -CFA -XCFA -p -c -fsyntax-only -o $(abspath ${@})
     190        $(CFACOMPILETEST) -CFA -XCFA -p -c -fsyntax-only -o $(abspath $(@))
    178191
    179192#------------------------------------------------------------------------------
     
    181194#------------------------------------------------------------------------------
    182195# tests that just validate syntax and compiler output should be compared to stderr
    183 CFACOMPILE_SYNTAX = $(CFACOMPILETEST) -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o $(abspath ${@})
     196CFACOMPILE_SYNTAX = $(CFACOMPILETEST) -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o $(abspath $(@))
    184197
    185198SYNTAX_ONLY_CODE = expression typedefRedef variableDeclarator switch numericConstants identFuncDeclarator \
     
    187200$(SYNTAX_ONLY_CODE): % : %.cfa $(CFACCBIN)
    188201        $(CFACOMPILE_SYNTAX)
    189         $(if $(test), cp $(test) $(abspath ${@}), )
     202        $(if $(test), cp $(test) $(abspath $(@)), )
    190203
    191204# expected failures
     
    193206alloc-ERROR : alloc.cfa $(CFACCBIN)
    194207        $(CFACOMPILE_SYNTAX) -DERR1
    195         -cp $(test) $(abspath ${@})
     208        -cp $(test) $(abspath $(@))
    196209
    197210init1-ERROR : init1.cfa $(CFACCBIN)
    198211        $(CFACOMPILE_SYNTAX) -DERR1
    199         -cp $(test) $(abspath ${@})
     212        -cp $(test) $(abspath $(@))
    200213
    201214typedefRedef-ERR1 : typedefRedef.cfa $(CFACCBIN)
    202215        $(CFACOMPILE_SYNTAX) -DERR1
    203         -cp $(test) $(abspath ${@})
     216        -cp $(test) $(abspath $(@))
    204217
    205218nested-types-ERR1 : nested-types.cfa $(CFACCBIN)
    206219        $(CFACOMPILE_SYNTAX) -DERR1
    207         -cp $(test) $(abspath ${@})
     220        -cp $(test) $(abspath $(@))
    208221
    209222nested-types-ERR2 : nested-types.cfa $(CFACCBIN)
    210223        $(CFACOMPILE_SYNTAX) -DERR2
    211         -cp $(test) $(abspath ${@})
     224        -cp $(test) $(abspath $(@))
    212225
    213226raii/memberCtors-ERR1 : raii/memberCtors.cfa $(CFACCBIN)
    214227        $(CFACOMPILE_SYNTAX) -DERR1
    215         -cp $(test) $(abspath ${@})
     228        -cp $(test) $(abspath $(@))
    216229
    217230raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa $(CFACCBIN)
    218231        $(CFACOMPILE_SYNTAX) -DERR1
    219         -cp $(test) $(abspath ${@})
     232        -cp $(test) $(abspath $(@))
    220233
    221234raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa $(CFACCBIN)
    222235        $(CFACOMPILE_SYNTAX) -DERR1
    223         -cp $(test) $(abspath ${@})
     236        -cp $(test) $(abspath $(@))
    224237
    225238raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa $(CFACCBIN)
    226239        $(CFACOMPILE_SYNTAX) -DERR2
    227         -cp $(test) $(abspath ${@})
     240        -cp $(test) $(abspath $(@))
    228241
    229242# Exception Tests
     
    231244
    232245exceptions/%-threads : exceptions/%.cfa $(CFACCBIN)
    233         $(CFACOMPILETEST) -include exceptions/with-threads.hfa -c -o $(abspath ${@}).o
    234         $(CFACCLOCAL) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g')) $(abspath ${@}).o -o $(abspath ${@})
     246        $(CFACOMPILETEST) -include exceptions/with-threads.hfa -c -o $(abspath $(@)).o
     247        $(CFACCLOCAL) $($(shell echo "$(@)_FLAGSLD" | sed 's/-\|\//_/g')) $(abspath $(@)).o -o $(abspath $(@))
    235248
    236249# Linking tests
    237250# Meta tests to make sure we see linking errors (can't compile with -O2 since it may multiply number of calls)
    238251linking/linkerror : linking/linkerror.cfa $(CFACCBIN)
    239         $(CFACOMPILETEST) -O0 -c -o $(abspath ${@}).o
    240         $(CFACCLINK)  -O0 ${@}.o -o $(abspath ${@})
    241         rm $(abspath ${@}).o
     252        $(CFACOMPILETEST) -O0 -c -o $(abspath $(@)).o
     253        $(CFACCLINK)  -O0 $(@).o -o $(abspath $(@))
     254        rm $(abspath $(@)).o
    242255
    243256#------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.