Permalink
Browse files

awk->gawk: Make the gawk dependency explicit

Until #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 committed Nov 19, 2017
1 parent 19d296d commit 953bf531ea1c0b36a5b32b05ede8c6c77e480009
Showing with 8 additions and 8 deletions.
  1. +1 −1 ld/Makefile.linker
  2. +5 −5 mk/genlink-config.mk
  3. +1 −1 mk/genlink-rules.mk
  4. +1 −1 scripts/genlinktest.sh
@@ -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=
@@ -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)

@@ -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 $< > $@
@@ -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

0 comments on commit 953bf53

Please sign in to comment.