Greetings,
Having a problem append to a file within a target. I have
the following:
dut:
@echo "Phase 1"
./shell_script 2>&1 >phase1.log
vlog $(VOPTS) >>phase1.
With GNU Make, we can implement a fairly effective version check mechanism.
# *-*-* vim settings *-*-*# :set list ts=3# inspired from:# a) J. Cumming
make book#b ) O'Reilly Mecklenburg make book.#c ) Paul Smith GNU Make
author.
SHELL := /bin/sh
NULL := ONE := 1
SPC := $(NULL) $(NULL
I am re-posting since the newlines are not working properly in the site:
# *-*-* vim settings *-*-*# :set list ts=3
SHELL := /bin/sh
NULL := ONE := 1
SPC := $(NULL) $(NULL)TAB := $(NULL) $(NULL)DOT := .
TRUE := $(ONE)FALSE := $(NULL)
VALID_FALSE_VALUES := 0 -0 0. $(NULL) 0.0
[0-9] := 0 1 2 3 4
The problem is with the line preceding the vlog line, where the order is
reversed.
dut: @echo phase 1;./shell_script 1> phase.log2>&1
vlog $(VOPTS) 1>> phase.log 2>&1
From: thomas.ly...@mrcy.com
To: help-make@gnu.org
Subject: Target appends to file?
Date: T
Then compare it to your desired version using sort -V
But only if you have a more recent version of gnu sort
Heh,
Malcolm
-Original Message-
From: help-make-bounces+mec=stowers@gnu.org
[mailto:help-make-bounces+mec=stowers@gnu.org] On Behalf Of David Aldrich
Sent: Wednesday, Ap
# *-*-* vim settings *-*-*
# :set list ts=3
SHELL := /bin/sh
NULL :=
ONE := 1
SPC := $(NULL) $(NULL)
TAB := $(NULL) $(NULL)
DOT := .
TRUE := $(ONE)
FALSE := $(NULL)
VALID_FALSE_VALUES := 0 -0 0. $(NULL) 0.0
[0-9] := 0 1 2 3 4 5 6 7 8 9
X16 := X X X X
X16 += $(X16)
As an alternative you can use bash and make's .ONESHELL to do your
logging. I believe this will require bash 4.x (or newer), but I could be
mistaken. Also, understand this will tie your build to bash because these
features are either unavailable in other shells (like the bourne shell) or
use diff
Followup/corrections to that last email:
The "printf" lines should've had the $$ doubled up:
> @echo $$(printf $@)
Also, I wanted to point out a difference between *-e* and *-o pipefail*:
$ bash -e -o pipefail -x -c 'false | (sleep 2; true) | false; echo Inner:
$?'; echo Outer: $?
+ false
+ sl