Skip to content

Commit

Permalink
mk rules: Improve behaviour when DEVICE is set to family. Improved Wa…
Browse files Browse the repository at this point in the history
…rning

The warning now uses family instead of subfamily, which is available
sooner.
  • Loading branch information
quitte authored and karlp committed Aug 18, 2016
1 parent 60ca09c commit 6aeb55c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mk/genlink-config.mk
Expand Up @@ -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

Expand Down
7 changes: 4 additions & 3 deletions scripts/genlink.awk
Expand Up @@ -23,6 +23,7 @@

BEGIN {
PAT = tolower(PAT);
family = PAT;
}
!/^#/{
#remove cr on windows
Expand All @@ -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) {
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 6aeb55c

Please sign in to comment.