Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRYify makefile generators, Restructure build directory, Allow additional targets from projcet.yaml #394

Closed

Conversation

theotherjimmy
Copy link
Contributor

The makefile classes (ARMCC, and GCC_ARM) both use a common superclass and share most code.
This should reduce matenince costs.

The build directory is now structured to exactly match the source directory.
This follows the principal of least surprise and allows the programmer of additional rules to elide some of the details as to how to locate sources.

Additional Targets (rules, actually) are now supported in all makefile-based templates.
For example to add the rule

$(OBJ_FOLDER)source/daplink/daplink.ld : source/daplink/daplink.lds | create_outputdir
    arm-none-eabi-cpp $^ -o $@ $(COMMON_FLAGS) $(INC_DIRS_F)"

to pre-process the linker script with the c pre-processor, one would have a configuration file like so:

tool_specific:
    make_gcc_arm:
        mcu:
            - cortex-m0
        linker_file: "$(OBJ_FOLDER)source/daplink/daplink.ld"
        misc:
            additional_targets:
                - "$(OBJ_FOLDER)source/daplink/daplink.ld : source/daplink/daplink.lds | create_outputdir \n\tarm-none-eabi-cpp $^ -o $@ $(COMMON_FLAGS) $(INC_DIRS_F)"

@theotherjimmy
Copy link
Contributor Author

Should resolve #371

@theotherjimmy
Copy link
Contributor Author

I will write up and add to the wiki how to add additional targets, what advantages they have over pre/post build scripts, and the gotchas that exist once this is merged.

@theotherjimmy
Copy link
Contributor Author

Breaking into two PRs: one as a refactor, and the other as the Restructuring and additional_targets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants