]> rtime.felk.cvut.cz Git - linux-conf-perf.git/blob - kconfig2sat/Makefile
kconfig2sat almost finished
[linux-conf-perf.git] / kconfig2sat / Makefile
1 MAKEFLAGS += --no-builtin-rules
2
3 .PHONY: all clean
4 .SUFFIXES:
5
6 all: kconfig2sat
7
8 SRC = kconfig2sat.cc lcp_utils.c kconfig/zconf.tab.c
9
10 CFLAGS = -Wall -O2 -ggdb -DDEBUG
11 CXXFLAGS = -std=c++11
12
13 OBJ_C = $(patsubst %.c,%.o,$(filter %.c,$(SRC)))
14 OBJ_CC = $(patsubst %.cc,%.o,$(filter %.cc,$(SRC)))
15
16
17 kconfig2sat: $(OBJ_CC) $(OBJ_C)
18         g++ $(CXXFLAGS) $(CFLAGS) -o $@ $^
19
20 %.o: %.c *.h kconfig/*.h
21         gcc -c $(CFLAGS) -o $@ $<
22
23 %.o: %.cc *.h kconfig/*.h
24         g++ -c $(CXXFLAGS) $(CFLAGS) -o $@ $<
25
26 %.hash.c: %.gperf
27         gperf -t --output-file $@ -a -C -E -g -k '1,3,$$' -p -t $<
28
29 %.lex.c: %.l
30         flex -o $@  -L -P zconf $<
31
32 kconfig/zconf.tab.c: $(addprefix kconfig/,zconf.lex.c zconf.hash.c util.c confdata.c expr.c symbol.c menu.c)
33 %.tab.c: %.y
34         bison -o $@ $< -p zconf -t -l
35
36 clean::
37         $(RM) kconfig2sat $(OBJ_C) $(OBJ_CC)
38         $(RM) kconfig/zconf.tab.c kconfig/zconf.lex.c kconfig/zconf.hash.c
39
40 .PHONY: test
41 test: all
42         grep -q bbb ../.target
43         ./kconfig2sat -k ../targets/bbb/linux/Kconfig --env ../.conf.mk --baseconf ../targets/bbb/build/.config --varfile ../dot_measure --cnf test.cnf --dot test.dot
44         dot -Tpdf test.dot > test.pdf
45
46 test2: all
47         ./kconfig2sat -k Kconfig.test --cnf test.cnf --dot test.dot
48         dot -Tpdf test.dot > test.pdf