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

Configuration variables cannot be set/overridden by target specific variable values #175

Open
Virtual-Java opened this issue Aug 1, 2021 · 1 comment
Labels

Comments

@Virtual-Java
Copy link

It is not possible to set/override LUFA configuration variables by target specific variable values.
e.g. the following target specific expression in makefile will be ignored. Instead of the target specific value the globally declared value will be taken when calling "make atmega8u2".

makefile_select_mcu
#global (default value):
MCU = atmega16u2
#target specific:
atmega8u2: MCU = atmega8u2

https://github.com/Virtual-Java/HoodLoader2/blob/automake/avr/bootloaders/HoodLoader2/makefile_select_mcu

Besides the LUFA configuration variable "TARGET" is a rather unfortunate choice for the target file, because it is in conflict with the Target to compile for. Is it possible to change the name of this variable in my makefile, so that the name can be used for different purposes?
Maybe the term "FILENAME" is a better description.
davr/lufa-lib@04ad8ba

@abcminiuser
Copy link
Owner

The TARGET variable likely is an unfortunate naming choice. It's used throughout the DMBS makefile build system so changing it both there and here is possible, but may cause issues for existing DMBS users (if there actually are any!).

The DMBS project uses TARGET to specify what the output artifacts will be named (the generated HEX, EEP and other files) and I usually also assume in the LUFA project makefiles that TARGET is also the name of the main source file. You're free to rename the main sources if needed however and just use the TARGET variable to name the output binaries; just change the $(TARGET).c in SRC to the actual name of your main source file.

Make supports default variable values, so you can use VARIABLE ?= default_value to set a default variable value if it is not already set.

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

No branches or pull requests

2 participants