summaryrefslogtreecommitdiff
path: root/scripts/kconfig/makefile
diff options
context:
space:
mode:
authorKacper <kacper@mail.openlinux.dev>2025-12-07 20:10:31 +0100
committerKacper <kacper@mail.openlinux.dev>2025-12-07 20:10:31 +0100
commitfc00c656c96528112d05cf0edf8631bd5eaea446 (patch)
treea6e0e6c588191a8bd1c64afc3b7a258e3e66c236 /scripts/kconfig/makefile
Add build system scaffolding and libc headers
Diffstat (limited to 'scripts/kconfig/makefile')
-rw-r--r--scripts/kconfig/makefile44
1 files changed, 44 insertions, 0 deletions
diff --git a/scripts/kconfig/makefile b/scripts/kconfig/makefile
new file mode 100644
index 00000000..6bfd24a1
--- /dev/null
+++ b/scripts/kconfig/makefile
@@ -0,0 +1,44 @@
+CC ?= gcc
+LEX ?= flex
+YACC ?= bison
+
+VPATH := $(srctree)/scripts/kconfig
+
+CFLAGS := -Iinclude
+LDFLAGS := -lncurses
+
+common-obj := confdata.o expr.o lexer.lex.o menu.o parser.tab.o \
+ preprocess.o symbol.o util.o
+
+lxdl-obj := checklist.o inputbox.o menubox.o \
+ textbox.o lutil.o yesno.o \
+ mnconf-common.o
+
+conf: conf.o $(common-obj)
+mconf: mconf.o $(common-obj) $(lxdl-obj)
+nconf: nconf.o nconf.gui.o mnconf-common.o $(common-obj)
+lexer.lex.c: lexer.l
+parser.tab.c parser.tab.h: parser.y
+
+%.lex.c: %.l
+ $(LEX) -o $@ $<
+
+parser.tab.c parser.tab.h: parser.y
+ $(YACC) -d -o parser.tab.c $<
+
+syncconfig: conf
+ scripts/kconfig/conf --syncconfig Kconfig .config
+
+menuconfig: mconf
+ scripts/kconfig/mconf Kconfig
+
+clean:
+ rm -f *.o lexer.lex.c parser.tab.c parser.tab.h conf mconf nconf
+
+%.o: %.c
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+%: %.o
+ $(CC) $(LDFLAGS) -o $@ $?
+
+.PHONY: menuconfig syncconfig clean