[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem setting a variable inside a target

From: Ed L Wolf
Subject: Problem setting a variable inside a target
Date: Sun, 24 Sep 2023 17:23:42 +0000



I am having some trouble trying to set a variable inside a target. When reading the variable, it comes up blank. Below is my make file code. The eval statement below highlighted in red is not working. Can you provide some assistance please? I am using GNU Make 4.1


$(DIR_A2LGEN_SETUP)/McData-setup.a2l: $(BSW_A2LS)  $(DIR_SCRIPTS)/update_mcdata_a2l.py $(DIR_SCRIPTS)/update_copyright_info.py $(DIR_SCRIPTS)/merge_a2l_files.py $(DIR_TARGET)/$(PROJECT).odx-f $(DIR_A2L)/Merger.ini

            @echo "A2L        $@"


            @rm -rf $(DIR_A2LGEN)

            @rm -rf $(DIR_A2LLOGS)

            @rm -rf $(DIR_A2LGEN_SETUP)

            @rm -rf $(DIR_A2LGEN_UPDATE)

            @rm -rf $(DIR_A2LGEN_MODIFY)

            @rm -rf $(DIR_A2LGEN_CHECK)

            @rm -rf $(DIR_A2LGEN_SUPPLIER)

            @mkdir -p $(DIR_A2LGEN)

            @mkdir -p $(DIR_A2LLOGS)

            @mkdir -p $(DIR_A2LGEN_SETUP)

            @mkdir -p $(DIR_A2LGEN_UPDATE)

            @mkdir -p $(DIR_A2LGEN_MODIFY)

            @mkdir -p $(DIR_A2LGEN_CHECK)

            @mkdir -p $(DIR_A2LGEN_SUPPLIER)



            @find $(DIR_BSWPROJECT) -type f -name "*.a2l" | xargs -i cp {} $(DIR_A2LGEN_SETUP)




#TODO: IS this still needed

            @cp $(DIR_A2L)/_Master*.a2l $(DIR_A2LGEN_SETUP)


            @python $(DIR_SCRIPTS)/update_mcdata_a2l.py $(DIR_A2LGEN_SETUP)


            @python $(DIR_SCRIPTS)/update_copyright_info.py \

        -a $(DIR_A2LGEN_SETUP)/McData.a2l.patched \

        -o $(DIR_A2LGEN_SETUP)/McData-copyright.a2l



            @python $(DIR_SCRIPTS)/merge_two_files.py \

                        -f1 $(CAN_A2L) \

                        -f2 $(DIR_A2LGEN_SETUP)/McData-copyright.a2l  \

                        -sp '/end DAQ'   \

                        -ep '/end IF_DATA'  \

                        -op $(DIR_A2LGEN_SETUP)/McData-copyright-can.a2l


# When there are no supplier a2l files then the merge process doesn't need to be done.


ifneq ($(wildcard $(DIR_SUPPLIER)),)

            @find $(DIR_SUPPLIER) -type f -name "*.a2l" | xargs -i cp {} $(DIR_A2LGEN_SUPPLIER)

            $(eval SUPPLIER_A2l := $(sort $(shell find $(DIR_A2LGEN_SUPPLIER) -type f -name "*.a2l")))

            @echo "A2L        Supplier folder detected"

            @echo "Supplier a2l         $(SUPPLIER_A2l)"



# Just becuase there is a supplier folder does not mean it has a2l files.

ifeq ($(SUPPLIER_A2l),"*.a2l")

            @echo "A2L        Supplier a2l files found"


            @python $(DIR_SCRIPTS)/merge_a2l_files.py \

                        -s $(DIR_A2LGEN_SUPPLIER) \

                        -b a2l_file_list_supplier.opt \

                        -P $(DIR_A2L)/Merger.ini \

                        -M $(DIR_A2LGEN_SETUP)/McData-copyright-can.a2l \

                        -O $(DIR_A2LGEN_SETUP)/McData-setup.a2l \

                        -L $(DIR_A2LLOGS)/Log0-A2LMerger.log \

                        -g $(DIR_BUILDGEN)


            @ASAP2Merger.exe \

                        @$(DIR_BUILDGEN)/a2l_file_list_supplier.opt \

                        > $(subst $(DIR_A2LGEN_SETUP),$(DIR_A2LLOGS),$(@:.a2l=.log)) \

                        || echo "A2L        $(DIR_A2LLOGS)/Log0-A2L-Supplier-Merger.log - Check for warnings/errors!"




            @cp $(DIR_A2LGEN_SETUP)/McData-copyright-can.a2l $(DIR_A2LGEN_SETUP)/McData-setup.a2l

            @echo "A2L        Supplier folder detected but no a2l files present"




            @cp $(DIR_A2LGEN_SETUP)/McData-copyright-can.a2l $(DIR_A2LGEN_SETUP)/McData-setup.a2l

            @echo "A2L        Supplier folder not available"



Ed L Wolf
Technical Advisor - Embedded Software
Cummins Inc.
Mail Code: C7004
1460 National Road
Columbus, Indiana 47201
United States


reply via email to

[Prev in Thread] Current Thread [Next in Thread]