]> rtime.felk.cvut.cz Git - linux-conf-perf.git/commitdiff
parse_kconfig make builds *.o files
authorKarel Kočí <cynerd@email.cz>
Sun, 12 Apr 2015 09:07:15 +0000 (11:07 +0200)
committerKarel Kočí <cynerd@email.cz>
Sun, 12 Apr 2015 09:07:15 +0000 (11:07 +0200)
Until now *.o files were not created.

scripts/parse_kconfig/Makefile
scripts/shared/kconfig/files.mk

index 85476176c50e23995730d25a9b50d9ae47ffa13c..c102a73e51e77c301d0eaa460013b14371fa3fe9 100644 (file)
@@ -1,3 +1,4 @@
+MAKEFLAGS += --no-builtin-rules
 .PHONY: all clean
 .SUFFIXES:
 
@@ -10,10 +11,16 @@ SRC  = parser.c \
               cnfexpr.c \
               symlist.c \
               output.c
+OBJ = $(patsubst %.c,%.o,$(SRC))
 CFLAGS = -O0 -w -ggdb
+INCLUDES = -I../shared
 
-parse: $(SRC) $(KCONFIG_SRC)
-       gcc $(CFLAGS) -o $@ $^ -I../shared
+%.o: %.c
+       gcc -c $(CFLAGS) -o $@ $^ $(INCLUDES)
+
+parse: $(OBJ) $(KCONFIG_OBJ)
+       gcc -o $@ $^
 
 clean::
+       $(RM) $(OBJ)
        $(RM) parser
index 5552991c98f37d3fc5736b61839f6e9d6a01c177..e51146a600e6822d0a471315a912627988682236 100644 (file)
@@ -7,6 +7,9 @@ ifndef KCONFIG_PREFIX
 endif
 
 KCONFIG_SRC = $(KCONFIG_PREFIX)/zconf.tab.c
+KCONFIG_OBJ = $(KCONFIG_PREFIX)/zconf.tab.o
+
+KCONFIG_CFLAGS = -O3
 
 %.hash.c: %.gperf
        gperf -t --output-file $@ -a -C -E -g -k '1,3,$$' -p -t $<
@@ -19,8 +22,11 @@ $(KCONFIG_PREFIX)/zconf.tab.c: $(KCONFIG_PREFIX)/zconf.hash.c
 %.tab.c: %.y
        bison -o $@ $< -p zconf -t -l
 
+$(KCONFIG_PREFIX)/zconf.tab.o: $(KCONFIG_PREFIX)/zconf.tab.c
+       gcc $(KCONFIG_CFLAGS) -c -o $@ $^
 
 clean::
+       $(RM) $(KCONFIG_OBJ)
        $(RM) $(KCONFIG_PREFIX)/zconf.tab.c
        $(RM) $(KCONFIG_PREFIX)/zconf.lex.c
        $(RM) $(KCONFIG_PREFIX)/zconf.hash.c