diff options
| author | Kacper <kacper@mail.openlinux.dev> | 2025-12-16 00:36:30 +0100 |
|---|---|---|
| committer | Kacper <kacper@mail.openlinux.dev> | 2025-12-16 00:36:30 +0100 |
| commit | 91ecd00cc83cf701fe7f73b1aa244c27174e8386 (patch) | |
| tree | c38ffefaa73e671fd917ca0b94b8adec53456a06 /scripts | |
| parent | 01cf24ec66c663e3f40be1d5c703aa9666effc85 (diff) | |
Add init prog, chroot syscall and fix menuconfig build
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/kconfig/makefile | 15 | ||||
| -rwxr-xr-x | scripts/kconfig/mconf | bin | 0 -> 224184 bytes | |||
| -rw-r--r-- | scripts/makefile.build | 31 |
3 files changed, 36 insertions, 10 deletions
diff --git a/scripts/kconfig/makefile b/scripts/kconfig/makefile index 6bfd24a1..bab0ef36 100644 --- a/scripts/kconfig/makefile +++ b/scripts/kconfig/makefile @@ -2,10 +2,8 @@ CC ?= gcc LEX ?= flex YACC ?= bison -VPATH := $(srctree)/scripts/kconfig - -CFLAGS := -Iinclude -LDFLAGS := -lncurses +CFLAGS += -Iinclude +LDFLAGS += -lcurses common-obj := confdata.o expr.o lexer.lex.o menu.o parser.tab.o \ preprocess.o symbol.o util.o @@ -17,7 +15,7 @@ lxdl-obj := checklist.o inputbox.o menubox.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 +lexer.lex.c: lexer.l | parser.tab.h parser.tab.c parser.tab.h: parser.y %.lex.c: %.l @@ -27,13 +25,14 @@ parser.tab.c parser.tab.h: parser.y $(YACC) -d -o parser.tab.c $< syncconfig: conf - scripts/kconfig/conf --syncconfig Kconfig .config + ./conf --syncconfig Kconfig $(srctree)/.config menuconfig: mconf - scripts/kconfig/mconf Kconfig + ./mconf $(srctree)/Kconfig + [ -f .config ] && mv -f .config $(srctree) || true clean: - rm -f *.o lexer.lex.c parser.tab.c parser.tab.h conf mconf nconf + rm -f *.o *.lex.c parser.tab.c parser.tab.h conf mconf nconf %.o: %.c $(CC) $(CFLAGS) -c -o $@ $< diff --git a/scripts/kconfig/mconf b/scripts/kconfig/mconf Binary files differnew file mode 100755 index 00000000..35f70dcb --- /dev/null +++ b/scripts/kconfig/mconf diff --git a/scripts/makefile.build b/scripts/makefile.build index fe8f1a78..7049d19c 100644 --- a/scripts/makefile.build +++ b/scripts/makefile.build @@ -21,7 +21,7 @@ endif objects := $(filter %.o,$(obj-y)) subdirs := $(filter %/,$(obj-y)) -cflags := $(cflags-y) $(KBUILD_CFLAGS) +cflags := $(cflags-y) $(KBUILD_CFLAGS) -MMD -MP asflags := $(asflags-y) $(KBUILD_ASFLAGS) ldflags := $(ldflags-y) $(KBUILD_LDFLAGS) @@ -39,6 +39,9 @@ else all-objects := $(objects) endif +deps := $(all-objects:.o=.d) +-include $(deps) + c-sources := $(wildcard $(addprefix $(obj),$(objects:.o=.c))) s-sources := $(wildcard $(addprefix $(obj),$(objects:.o=.s))) subdir-c-sources := $(wildcard $(addprefix $(obj),$(subdir-objects:.o=.c))) @@ -51,14 +54,38 @@ all: $(obj)$(lib-y) $(addprefix $(obj),$(always)) $(obj)$(lib-y): $(addprefix $(obj),$(all-objects)) $(MSG) AR "$@" $(Q)$(AR) rcs $@ $^ + +$(O)/$(install-y): $(obj)$(lib-y) + mkdir -p $(O)/$(dir $(install-y)) + install -m 0644 $< $(O)/$(install-y) + +ifdef install-y +install: $(O)/$(install-y) +else +install: +endif + else ifdef bin-y all: $(obj)$(bin-y) $(addprefix $(obj),$(always)) $(obj)$(bin-y): $(addprefix $(obj),$(all-objects)) $(libs-y) ${prereq} $(MSG) LD "$@" $(Q)$(LD) $(ldflags) -o $@ $^ + +ifdef install-y +$(O)/$(install-y): $(obj)$(bin-y) + mkdir -p $(O)/$(dir $(install-y)) + install -m 0755 $< $(O)/$(install-y) + +install: $(O)/$(install-y) +else +install: +endif + else all: $(addprefix $(obj),$(all-objects)) $(subdirs) $(addprefix $(obj),$(always)) + +install: $(subdirs) endif PHONY += clean clean-% @@ -92,7 +119,7 @@ $(filter $(addprefix $(obj),$(all-objects)),$(s-sources:.s=.o) $(subdir-s-source .PHONY: $(subdirs) $(subdirs): - $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.build obj="$(obj)$@" + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.build obj="$(obj)$@" ${MAKECMDGOALS} clean-%: $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.build obj="$(obj)$*" clean |
