[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Using grep inside makefile for loop
From: |
givemecode |
Subject: |
Using grep inside makefile for loop |
Date: |
Mon, 17 Jan 2011 10:28:11 -0800 (PST) |
I saw this question was posted but never answered on this forum. Hopefully
this can be done:
I have code in a makefile that creates a new file called "allheaders.h"
which includes ALL the headers, and is intended to verify they compile:
allheaders.h $(HEADER)
@for f in $(HEADER) ; do echo "#include \""$$f"\"" >> $@ ; done
where HEADER is just a bunch of header files inside the include directory:
HEADER = include/a.h
HEADER += include/b.h
HEADER += include/c.h
...
How do I do something similar to grep in the for loop, so as not to include
the "include/" part of the header rule?
For instance, I currently have this inside my allheaders.h file:
#include "include/a.h"
#include "include/b.h"
#include "include/c/h"
....
but I want just:
#include "a.h"
#include "b.h"
...
they are essential the same but I would like it to be the second list.
thanks!!
--
View this message in context:
http://old.nabble.com/Using-grep-inside-makefile-for-loop-tp30676223p30676223.html
Sent from the Gnu - Make - Help mailing list archive at Nabble.com.
- Using grep inside makefile for loop,
givemecode <=