X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/0765e7c133eb393d8cd0292af444543c2edf8ccc..29891c3ccec4f1d28e0440d87ea2e2708377d2ee:/lunaix-os/makefile?ds=sidebyside diff --git a/lunaix-os/makefile b/lunaix-os/makefile index c332bf7..09ee4b9 100644 --- a/lunaix-os/makefile +++ b/lunaix-os/makefile @@ -28,9 +28,7 @@ $(DEPS): echo "failed" && exit 1;\ fi -check-cc: - @echo -n "checking target i686-elf.... " - @test "`i686-elf-gcc -dumpmachine`" = "i686-elf" && echo ok || (echo "failed" && exit 1) +all_lconfigs = $(shell find . -name "LConfig") $(kbuild_dir): @mkdir -p $(kbin_dir) @@ -39,10 +37,18 @@ $(kbuild_dir): @mkdir -p $(os_img_dir)/boot/grub @mkdir -p $(os_img_dir)/usr +.builder/configs.h: $(all_lconfigs) + @echo restarting configuration... + @echo + @./scripts/build-tools/luna_build.py --config --lconfig-file LConfig -o $(@D) + +.builder/lbuild.mkinc: .builder/configs.h + @./scripts/build-tools/luna_build.py LBuild --lconfig-file LConfig -o $(@D) + .PHONY: kernel export BUILD_DIR=$(kbin_dir) export BUILD_NAME=$(kbin) -kernel: +kernel: .builder/lbuild.mkinc $(call status,TASK,$(notdir $@)) @$(MAKE) $(MKFLAGS) -I $(mkinc_dir) -f kernel.mk all @@ -51,14 +57,15 @@ export KCMD=$(CMDLINE) export _OS_NAME=$(OS_NAME) image: usr/build kernel $(call status,TASK,$(notdir $@)) - @./config-grub.sh $(os_img_dir)/boot/grub/grub.cfg + @./scripts/grub/config-grub.sh $(os_img_dir)/boot/grub/grub.cfg @cp -r usr/build/* $(os_img_dir)/usr @cp -r $(kbin_dir)/* $(os_img_dir)/boot - @grub-mkrescue -o $(kimg) $(os_img_dir) -- -volid "$(OS_ID) $(OS_VER)" -system_id "$(OS_NAME)" + @grub-mkrescue -o $(kimg) $(os_img_dir)\ + -- -volid "$(OS_ID) $(OS_VER)" -system_id "$(OS_NAME)" usr/build: user -check: $(DEPS) check-cc GRUB_TEMPLATE +check: $(DEPS) check-cc scripts/grub/GRUB_TEMPLATE prepare: check $(os_img_dir) @@ -80,17 +87,18 @@ instable: all all-debug: bootable-debug clean: - @rm -rf $(kbuild_dir) || exit 1 @$(MAKE) -C usr clean -I $(mkinc_dir) @$(MAKE) -f kernel.mk clean -I $(mkinc_dir) + @rm -rf $(kbuild_dir) || exit 1 + @rm -f .builder/lbuild.mkinc || exit 1 -run: $(BUILD_DIR)/$(OS_ISO) - @qemu-system-i386 $(QEMU_OPTIONS) +run: all + @qemu-system-i386 $(call get_qemu_options,$(kimg)) @sleep 1 @telnet 127.0.0.1 $(QEMU_MON_PORT) debug-qemu: all-debug - @i686-elf-objcopy --only-keep-debug $(kbin) $(kbuild_dir)/kernel.dbg + @objcopy --only-keep-debug $(kbin) $(kbuild_dir)/kernel.dbg @qemu-system-i386 $(call get_qemu_options,$(kimg)) @sleep 1 @QMPORT=$(QEMU_MON_PORT) gdb $(kbin) -ex "target remote localhost:1234"