Skip to content

Commit

Permalink
awk->gawk: Make the gawk dependency explicit
Browse files Browse the repository at this point in the history
Until libopencm3#732 has been
fixed, it's not enough to just have it in the README that you need GNU
awk.  Explicitly use the "gawk" command name.  This exists on (sane)
systems that have gawk as awk, and for systems that use mawk as default,
the gawk name should also exist.

This should make it significantly easier to diagnost the cause of build
problems.
  • Loading branch information
karlp authored and BOJIT committed Jan 30, 2021
1 parent 66e08e0 commit babed18
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ld/Makefile.linker
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
ifneq ($(DEVICE),)

LDSCRIPT=$(DEVICE).ld
LD_PARAMS=$(shell awk -v PAT="$(DEVICE)" -f $(SRCLIBDIR)/scripts/genlink.awk $(SRCLIBDIR)/ld/devices.data 2>/dev/null)
LD_PARAMS=$(shell gawk -v PAT="$(DEVICE)" -f $(SRCLIBDIR)/scripts/genlink.awk $(SRCLIBDIR)/ld/devices.data 2>/dev/null)
CFLAGS+=$(LD_PARAMS)
LDFLAGS+=$(LD_PARAMS)
ARCH_FLAGS=
Expand Down
10 changes: 5 additions & 5 deletions mk/genlink-config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ endif
LDSCRIPT = generated.$(DEVICE).ld
DEVICES_DATA = $(OPENCM3_DIR)/ld/devices.data

genlink_family :=$(shell awk -v PAT="$(DEVICE)" -v MODE="FAMILY" -f $(OPENCM3_DIR)/scripts/genlink.awk $(DEVICES_DATA))
genlink_subfamily :=$(shell awk -v PAT="$(DEVICE)" -v MODE="SUBFAMILY" -f $(OPENCM3_DIR)/scripts/genlink.awk $(DEVICES_DATA))
genlink_cpu :=$(shell awk -v PAT="$(DEVICE)" -v MODE="CPU" -f $(OPENCM3_DIR)/scripts/genlink.awk $(DEVICES_DATA))
genlink_fpu :=$(shell awk -v PAT="$(DEVICE)" -v MODE="FPU" -f $(OPENCM3_DIR)/scripts/genlink.awk $(DEVICES_DATA))
genlink_cppflags :=$(shell awk -v PAT="$(DEVICE)" -v MODE="CPPFLAGS" -f $(OPENCM3_DIR)/scripts/genlink.awk $(DEVICES_DATA))
genlink_family :=$(shell gawk -v PAT="$(DEVICE)" -v MODE="FAMILY" -f $(OPENCM3_DIR)/scripts/genlink.awk $(DEVICES_DATA))
genlink_subfamily :=$(shell gawk -v PAT="$(DEVICE)" -v MODE="SUBFAMILY" -f $(OPENCM3_DIR)/scripts/genlink.awk $(DEVICES_DATA))
genlink_cpu :=$(shell gawk -v PAT="$(DEVICE)" -v MODE="CPU" -f $(OPENCM3_DIR)/scripts/genlink.awk $(DEVICES_DATA))
genlink_fpu :=$(shell gawk -v PAT="$(DEVICE)" -v MODE="FPU" -f $(OPENCM3_DIR)/scripts/genlink.awk $(DEVICES_DATA))
genlink_cppflags :=$(shell gawk -v PAT="$(DEVICE)" -v MODE="CPPFLAGS" -f $(OPENCM3_DIR)/scripts/genlink.awk $(DEVICES_DATA))

CPPFLAGS += $(genlink_cppflags)

Expand Down
2 changes: 1 addition & 1 deletion mk/genlink-rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@

$(LDSCRIPT):$(OPENCM3_DIR)/ld/linker.ld.S
@printf " GENLNK $(DEVICE)\n"
$(Q)$(CPP) $(ARCH_FLAGS) $(shell awk -v PAT="$(DEVICE)" -v MODE="DEFS" -f $(OPENCM3_DIR)/scripts/genlink.awk $(OPENCM3_DIR)/ld/devices.data 2>/dev/null) -P -E $< > $@
$(Q)$(CPP) $(ARCH_FLAGS) $(shell gawk -v PAT="$(DEVICE)" -v MODE="DEFS" -f $(OPENCM3_DIR)/scripts/genlink.awk $(OPENCM3_DIR)/ld/devices.data 2>/dev/null) -P -E $< > $@
2 changes: 1 addition & 1 deletion scripts/genlinktest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

# run test
PAAT=`basename $1`;
awk -v PAT="$PAAT" -f scripts/genlink.awk $1.data > $1.out;
gawk -v PAT="$PAAT" -f scripts/genlink.awk $1.data > $1.out;

#check test
if ! diff -q $1.out $1.result >/dev/null; then
Expand Down

0 comments on commit babed18

Please sign in to comment.