|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Makefiles: Writing list to screen
I have a make file and want to write some information and am doing Code:
@echo " RAYPK_LIBSRC = $(RAYPK_LIBSRC)" The line of code produces Code:
RAYPK_LIBSRC = ./source/library/raypk/time.f ./source/library/raypk/model.f ./source/library/raypk/tomo.f ./source/library/raypk/plt.f ./source/library/raypk/blkdat.f I want the information displayed as follows Code:
RAYPK_LIBSRC = ./source/library/raypk/time.f
./source/library/raypk/model.f
./source/library/raypk/tomo.f
./source/library/raypk/plt.f
./source/library/raypk/blkdat.f---------- Post updated at 06:31 AM ---------- Previous update was at 06:09 AM ---------- I have done this Code:
@echo "RAYPK_LIBOBJ ="
for i in $(RAYPK_LIBOBJ); do \
echo " $$i"; \
doneproducing Code:
RAYPK_LIBOBJ =
for i in ./BUILD_DIR/obj/time.o ./BUILD_DIR/obj/model.o ./BUILD_DIR/obj/tomo.o ./BUILD_DIR/obj/plt.o ./BUILD_DIR/obj/blkdat.o; do \
echo " $i"; \
done
./BUILD_DIR/obj/time.o
./BUILD_DIR/obj/model.o
./BUILD_DIR/obj/tomo.o
./BUILD_DIR/obj/plt.o
./BUILD_DIR/obj/blkdat.oThis is almost what I want. Got to remove the printing of the for loop. On addition, the first string Code:
./BUILD_DIR/obj/time.o needs to be next to Code:
RAYPK_LIBOBJ = ---------- Post updated at 06:39 AM ---------- Previous update was at 06:31 AM ---------- And doing something like this Code:
$(foreach s,$(RAYPK_LIBOBJ), @echo " $(s)"\n;) gives errors Code:
RAYPK_LIBOBJ =
./BUILD_DIR/obj/time.on
/bin/sh: @echo: command not found
/bin/sh: @echo: command not found
/bin/sh: @echo: command not found
/bin/sh: @echo: command not found
make: *** [list] Error 127---------- Post updated at 11:00 AM ---------- Previous update was at 06:39 AM ---------- I have made some progress on this Code:
@echo "RAYPK_LIBOBJ = $(word 1, $(RAYPK_LIBOBJ))"
@$(foreach s,$(RAYPK_LIBOBJ), echo " $(s)";)This produces Code:
RAYPK_LIBOBJ = ./BUILD_DIR/obj/time.o
./BUILD_DIR/obj/time.o
./BUILD_DIR/obj/model.o
./BUILD_DIR/obj/tomo.o
./BUILD_DIR/obj/plt.o
./BUILD_DIR/obj/blkdat.oSo the last thing remaining is not to print again Code:
./BUILD_DIR/obj/time.o when dong the foreach loop. |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
I like Code:
echo ... | while read l ;do ...; done |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Makefiles for different programs | kristinu | Programming | 1 | 01-03-2013 05:56 PM |
| makefiles | klam | UNIX for Advanced & Expert Users | 0 | 09-23-2006 02:56 PM |
| How can I print variables im using in makefiles? | umen | Shell Programming and Scripting | 1 | 05-07-2006 09:57 AM |
| makefiles in a directory and subdirectories | benjie_asu | UNIX for Dummies Questions & Answers | 0 | 10-28-2005 01:34 PM |
| Combining makefiles | Dan Rooney | UNIX for Advanced & Expert Users | 4 | 05-07-2004 08:19 AM |
|
|