help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Rename positional parameters in customized GNU make functions to enhance


From: Hongyi Zhao
Subject: Rename positional parameters in customized GNU make functions to enhance readability and maintainability.
Date: Fri, 21 Jan 2022 18:34:36 +0800

I try to redefine the download_and_unpack function used here [1] as follows:

```
define download_and_unpack
  @package := $(1)
  @package_URL := $(2)
  @package_directory := $(3)
  @package_code := $(4)
  @package_archive := ../archive/`echo "$(package)" | sed 's/.*\///;s/.*=//'`
[...]
endef
```
As you can see, I try to rename the positional parameters in
customized GNU make functions to enhance readability and
maintainability. But when I run my revised version, the following
error will be triggered:

```
$ make -j44 w90
test -d bin || mkdir bin
cd install ; make -f extlibs_makefile liblapack
make[1]: Entering directory '/home/werner/q-e/install'
make[1]: Nothing to be done for 'liblapack'.
make[1]: Leaving directory '/home/werner/q-e/install'
( cd install ; make -f plugins_makefile w90 || exit 1 )
make[1]: Entering directory '/home/werner/q-e/install'
make[1]: package: Command not found
make[1]: *** [plugins_makefile:94: uncompress-w90] Error 127
make[1]: Leaving directory '/home/werner/q-e/install'
make: *** [Makefile:239: w90] Error 1
```

Is it possible to achieve the purpose I described above? If possible,
any hints for fixing the problem?

[1] https://gitlab.com/QEF/q-e/-/blob/develop/install/install_utils

Regards
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province



reply via email to

[Prev in Thread] Current Thread [Next in Thread]