aboutsummaryrefslogtreecommitdiff
path: root/scripts/shared/kconfig/files.mk
blob: e51146a600e6822d0a471315a912627988682236 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Files in this folder are exported from kernel source tree (except this file)
# 	commit: e5e02de0665ef2477e7a018193051387c6fe0fbc
.PHONY: clean

ifndef KCONFIG_PREFIX
	$(error "Please specify variable KCONFIG_SRC in your makefile before importing kconfig files.mk")
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 $<

%.lex.c: %.l
	flex -o $@  -L -P zconf $<

$(KCONFIG_PREFIX)/zconf.tab.c: $(KCONFIG_PREFIX)/zconf.lex.c
$(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