mk: avoid multiple inclusion of rte_config.h

Signed-off-by: Intel
This commit is contained in:
Intel 2013-11-08 03:00:00 +01:00 committed by Thomas Monjalon
parent dcae8715b8
commit ac33030524
2 changed files with 4 additions and 1 deletions

View File

@ -43,7 +43,6 @@ MODULE_CFLAGS += -I$(SRCDIR) --param max-inline-insns-single=50
MODULE_CFLAGS += -I$(RTE_OUTPUT)/include -I$(SRCDIR)/ethtool/ixgbe -I$(SRCDIR)/ethtool/igb
MODULE_CFLAGS += -include $(RTE_OUTPUT)/include/rte_config.h
MODULE_CFLAGS += -Wall -Werror
MODULE_CFLAGS += -include $(RTE_OUTPUT)/include/rte_config.h
# this lib needs main eal
DEPDIRS-y += lib/librte_eal/linuxapp/eal

View File

@ -31,9 +31,13 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
echo "#ifndef __RTE_CONFIG_H"
echo "#define __RTE_CONFIG_H"
grep CONFIG_ $1 \
| grep -v '^#' \
| sed 's,CONFIG_\(.*\)=y.*$,#define \1 1,' \
| sed 's,CONFIG_\(.*\)=n.*$,#undef \1,' \
| sed 's,CONFIG_\(.*\)=\(.*\)$,#define \1 \2,' \
| sed 's,\# CONFIG_\(.*\) is not set$,#undef \1,'
echo "#endif /* __RTE_CONFIG_H */"