mk rules: Improve behaviour when DEVICE is set to family. Improved Warning

The warning now uses family instead of subfamily, which is available
sooner.
This commit is contained in:
Jonas Meyer 2016-02-18 20:20:51 +01:00 committed by Karl Palsson
parent 60ca09c61e
commit 6aeb55c5d7
2 changed files with 5 additions and 4 deletions

View File

@ -60,7 +60,7 @@ else
ifneq (,$(wildcard $(OPENCM3_DIR)/lib/libopencm3_$(genlink_subfamily).a))
LDLIBS += -lopencm3_$(genlink_subfamily)
else
$(warning $(OPENCM3_DIR)/lib/libopencm3_$(genlink_subfamily).a library variant for the selected device does not exist.)
$(warning $(OPENCM3_DIR)/lib/libopencm3_$(genlink_family).a library variant for the selected device does not exist.)
endif
endif

View File

@ -23,6 +23,7 @@
BEGIN {
PAT = tolower(PAT);
family = PAT;
}
!/^#/{
#remove cr on windows
@ -35,6 +36,8 @@ BEGIN {
tolower(tmp);
if (PAT ~ tmp) {
if ("CPPFLAGS" == MODE)
printf "-D%s ",toupper(PAT);
if ($2 != "+")
PAT=$2;
for (i = 3; i <= NF; i = i + 1) {
@ -67,9 +70,7 @@ BEGIN {
else{
subfamily = family;
family = PAT;
if ("CPPFLAGS" == MODE)
printf "-D%s ",toupper(PAT);
else if("DEFS" == MODE)
if("DEFS" == MODE)
printf "-D%s ",toupper(PAT);
}
}