Make paths more uniform across architectures; adjust the build system and Github workflows accordingly.

* move x86/x86-64-specific files to boot/x86, build/ia32, build/x64, system/x86, system/imc/x86;
* move build64/la64 to build/loongarch64;
* rename system/imc/loongson to system/img/loongarch.
This commit is contained in:
Lionel Debroux 2024-09-29 22:16:55 +02:00
parent 9053696e12
commit 3fafea11e3
36 changed files with 104 additions and 132 deletions

View File

@ -45,11 +45,11 @@ jobs:
working-directory: ./ working-directory: ./
run: | run: |
if [ ${{ matrix.arch }} == 'i386' ]; then if [ ${{ matrix.arch }} == 'i386' ]; then
cd build32 cd build/ia32
elif [ ${{ matrix.arch }} == 'x86_64' ]; then elif [ ${{ matrix.arch }} == 'x86_64' ]; then
cd build64 cd build/x64
elif [ ${{ matrix.arch }} == 'la64' ]; then elif [ ${{ matrix.arch }} == 'la64' ]; then
cd build64/la64 cd build/loongarch64
fi fi
make clean make clean
@ -57,11 +57,11 @@ jobs:
working-directory: ./ working-directory: ./
run: | run: |
if [ ${{ matrix.arch }} == 'i386' ]; then if [ ${{ matrix.arch }} == 'i386' ]; then
cd build32 cd build/ia32
elif [ ${{ matrix.arch }} == 'x86_64' ]; then elif [ ${{ matrix.arch }} == 'x86_64' ]; then
cd build64 cd build/x64
elif [ ${{ matrix.arch }} == 'la64' ]; then elif [ ${{ matrix.arch }} == 'la64' ]; then
export PATH=/opt/LoongArch_Toolchains/cross-tools/bin/:$PATH export PATH=/opt/LoongArch_Toolchains/cross-tools/bin/:$PATH
cd build64/la64 cd build/loongarch64
fi fi
make -j 2 CC="${{matrix.compiler}}" iso make -j 2 CC="${{matrix.compiler}}" iso

View File

@ -25,38 +25,38 @@ else
MS_LDS=ldscripts/memtest_shared.lds MS_LDS=ldscripts/memtest_shared.lds
endif endif
INC_DIRS = -I../boot -I../system -I../lib -I../tests -I../app -Iapp INC_DIRS = -I../../boot -I../../system -I../../system/imc -I../../system/x86 -I../../lib -I../../tests -I../../app -Iapp
SYS_OBJS = system/acpi.o \ SYS_OBJS = system/acpi.o \
system/cpuid.o \
system/cpuinfo.o \
system/cpulocal.o \ system/cpulocal.o \
system/ehci.o \ system/ehci.o \
system/font.o \ system/font.o \
system/heap.o \ system/heap.o \
system/hwctrl.o \
system/hwquirks.o \ system/hwquirks.o \
system/keyboard.o \ system/keyboard.o \
system/ohci.o \ system/ohci.o \
system/memctrl.o \
system/pci.o \ system/pci.o \
system/pmem.o \ system/pmem.o \
system/reloc.o \ system/reloc.o \
system/screen.o \ system/screen.o \
system/serial.o \ system/serial.o \
system/smbios.o \ system/smbios.o \
system/i2c_x86.o \
system/spd.o \ system/spd.o \
system/smp.o \ system/smp.o \
system/temperature.o \
system/timers.o \ system/timers.o \
system/uhci.o \ system/uhci.o \
system/usbhcd.o \ system/usbhcd.o \
system/vmem.o \ system/xhci.o \
system/xhci.o system/x86/cpuid.o \
system/x86/cpuinfo.o \
system/x86/hwctrl.o \
system/x86/i2c.o \
system/x86/memctrl.o \
system/x86/temperature.o \
system/x86/vmem.o
IMC_SRCS = $(wildcard ../system/imc/*.c) IMC_SRCS = $(wildcard ../../system/imc/x86/*.c)
IMC_OBJS = $(subst ../,,$(IMC_SRCS:.c=.o)) IMC_OBJS = $(subst ../../,,$(IMC_SRCS:.c=.o))
LIB_OBJS = lib/barrier.o \ LIB_OBJS = lib/barrier.o \
lib/div64.o \ lib/div64.o \
@ -80,10 +80,10 @@ APP_OBJS = app/badram.o \
app/config.o \ app/config.o \
app/display.o \ app/display.o \
app/error.o \ app/error.o \
app/interrupt.o \ app/main.o \
app/main.o app/x86/interrupt.o
OBJS = boot/startup.o boot/efisetup.o $(SYS_OBJS) $(IMC_OBJS) $(LIB_OBJS) $(TST_OBJS) $(APP_OBJS) OBJS = boot/x86/startup.o boot/efisetup.o $(SYS_OBJS) $(IMC_OBJS) $(LIB_OBJS) $(TST_OBJS) $(APP_OBJS)
all: mt86plus all: mt86plus
@ -102,49 +102,57 @@ debug: check memtest.debug mt86plus
-include $(subst .o,.d,$(TST_OBJS)) -include $(subst .o,.d,$(TST_OBJS))
-include $(subst .o,.d,$(APP_OBJS)) -include $(subst .o,.d,$(APP_OBJS))
boot/header.o : | ../boot/sbat.csv boot/x86/header.o : | ../../boot/sbat.csv
boot/startup.o: ../boot/startup32.S ../boot/boot.h boot/x86/startup.o: ../../boot/x86/startup32.S ../../boot/boot.h
@mkdir -p boot/x86
$(CC) -m32 -x assembler-with-cpp -c -I../../boot -o $@ $<
boot/%.o: ../../boot/%.S ../../boot/boot.h app/build_version.h
@mkdir -p boot @mkdir -p boot
$(CC) -m32 -x assembler-with-cpp -c -I../boot -o $@ $< $(CC) -m32 -x assembler-with-cpp -c -I../../boot -Iapp -o $@ $<
boot/%.o: ../boot/%.S ../boot/boot.h app/build_version.h boot/efisetup.o: ../../boot/efisetup.c
@mkdir -p boot
$(CC) -m32 -x assembler-with-cpp -c -I../boot -Iapp -o $@ $<
boot/efisetup.o: ../boot/efisetup.c
@mkdir -p boot @mkdir -p boot
$(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d) $(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d)
system/reloc.o: ../system/reloc32.c system/reloc.o: ../../system/reloc32.c
@mkdir -p system @mkdir -p system
$(CC) -c $(CFLAGS) -fno-strict-aliasing $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d) $(CC) -c $(CFLAGS) -fno-strict-aliasing $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d)
system/%.o: ../system/%.c system/%.o: ../../system/%.c
@mkdir -p system @mkdir -p system
$(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d) $(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d)
system/imc/%.o: ../system/imc/%.c system/imc/x86/%.o: ../../system/imc/x86/%.c
@mkdir -p system/imc @mkdir -p system/imc/x86
$(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d) $(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d)
lib/%.o: ../lib/%.c system/x86/%.o: ../../system/x86/%.c
@mkdir -p system/x86
$(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d)
lib/%.o: ../../lib/%.c
@mkdir -p lib @mkdir -p lib
$(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d) $(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d)
tests/%.o: ../tests/%.c tests/%.o: ../../tests/%.c
@mkdir -p tests @mkdir -p tests
$(CC) -c $(CFLAGS) $(OPT_FAST) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d) $(CC) -c $(CFLAGS) $(OPT_FAST) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d)
app/%.o: ../app/%.c app/build_version.h app/%.o: ../../app/%.c app/build_version.h
@mkdir -p app @mkdir -p app
$(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d) $(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d)
app/x86/%.o: ../../app/x86/%.c app/build_version.h
@mkdir -p app/x86
$(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d)
app/build_version.h: FORCE app/build_version.h: FORCE
@mkdir -p app @mkdir -p app
@( \ @( \
cp -f ../app/version.h $@.tmp; \ cp -f ../../app/version.h $@.tmp; \
if $(GIT_AVAILABLE) && test -d ../.git ; then \ if $(GIT_AVAILABLE) && test -d ../../.git ; then \
hash=`git rev-parse HEAD | cut -c1-7`; \ hash=`git rev-parse HEAD | cut -c1-7`; \
sed -i 's/GIT_HASH\s\".*"/GIT_HASH "'$$hash'"/' $@.tmp; \ sed -i 's/GIT_HASH\s\".*"/GIT_HASH "'$$hash'"/' $@.tmp; \
else \ else \
@ -171,12 +179,12 @@ memtest.debug: memtest_shared
strip -R .eh_frame memtest_shared strip -R .eh_frame memtest_shared
strip -R .comment memtest_shared strip -R .comment memtest_shared
mt86plus: memtest_shared.bin boot/header.o ldscripts/memtest_efi.lds mt86plus: memtest_shared.bin boot/x86/header.o ldscripts/memtest_efi.lds
$(eval SIZES=$(shell size -B -d memtest_shared | grep memtest_shared)) $(eval SIZES=$(shell size -B -d memtest_shared | grep memtest_shared))
$(LD) --defsym=_bss_size=$(word 3,$(SIZES)) -T ldscripts/memtest_efi.lds boot/header.o -b binary memtest_shared.bin -o mt86plus $(LD) --defsym=_bss_size=$(word 3,$(SIZES)) -T ldscripts/memtest_efi.lds boot/x86/header.o -b binary memtest_shared.bin -o mt86plus
memtest.mbr: memtest_shared.bin boot/mbr.o ldscripts/memtest_mbr.lds memtest.mbr: memtest_shared.bin boot/x86/mbr.o ldscripts/memtest_mbr.lds
$(LD) -T ldscripts/memtest_mbr.lds boot/mbr.o -b binary memtest_shared.bin -o memtest.mbr $(LD) -T ldscripts/memtest_mbr.lds boot/x86/mbr.o -b binary memtest_shared.bin -o memtest.mbr
floppy.img: mt86plus floppy.img: mt86plus
dd if=/dev/zero of=floppy.img bs=1474560 count=1 dd if=/dev/zero of=floppy.img bs=1474560 count=1
@ -235,22 +243,22 @@ grub-eltorito.img:
grub-bootia32.efi: grub-bootia32.efi:
$(GRUB_MKIMAGE) --output $@ --prefix /EFI/BOOT/grub --format i386-efi $(GRUB_MODULES) $(GRUB_MKIMAGE) --output $@ --prefix /EFI/BOOT/grub --format i386-efi $(GRUB_MODULES)
grub-esp.img: mt86plus grub-bootia32.efi ../grub/${GRUB_CFG}-efi.cfg grub-esp.img: mt86plus grub-bootia32.efi ../../grub/${GRUB_CFG}-efi.cfg
@mkdir -p grub-iso/EFI/BOOT/grub/i386-efi grub-iso/EFI/BOOT/grub/fonts @mkdir -p grub-iso/EFI/BOOT/grub/i386-efi grub-iso/EFI/BOOT/grub/fonts
cp mt86plus grub-iso/EFI/BOOT/memtest cp mt86plus grub-iso/EFI/BOOT/memtest
cp grub-bootia32.efi grub-iso/EFI/BOOT/bootia32.efi cp grub-bootia32.efi grub-iso/EFI/BOOT/bootia32.efi
cp ../grub/${GRUB_CFG}-efi.cfg grub-iso/EFI/BOOT/grub/grub.cfg cp ../../grub/${GRUB_CFG}-efi.cfg grub-iso/EFI/BOOT/grub/grub.cfg
cp $(GRUB_FONT_DIR)/unicode.pf2 grub-iso/EFI/BOOT/grub/fonts/ cp $(GRUB_FONT_DIR)/unicode.pf2 grub-iso/EFI/BOOT/grub/fonts/
cp $(GRUB_LIB_DIR)/i386-efi/*.mod grub-iso/EFI/BOOT/grub/i386-efi/ cp $(GRUB_LIB_DIR)/i386-efi/*.mod grub-iso/EFI/BOOT/grub/i386-efi/
@rm -f grub-esp.img @rm -f grub-esp.img
/sbin/mkdosfs -n MT86P_ESP -F12 -C grub-esp.img 8192 /sbin/mkdosfs -n MT86P_ESP -F12 -C grub-esp.img 8192
mcopy -s -i grub-esp.img grub-iso/EFI :: mcopy -s -i grub-esp.img grub-iso/EFI ::
grub-memtest.iso: mt86plus grub-eltorito.img ../grub/${GRUB_CFG}-legacy.cfg grub-esp.img grub-memtest.iso: mt86plus grub-eltorito.img ../../grub/${GRUB_CFG}-legacy.cfg grub-esp.img
@mkdir -p grub-iso/boot/grub/i386-pc grub-iso/boot/grub/fonts @mkdir -p grub-iso/boot/grub/i386-pc grub-iso/boot/grub/fonts
cp mt86plus grub-iso/boot/memtest cp mt86plus grub-iso/boot/memtest
cp grub-eltorito.img grub-iso/boot/eltorito.img cp grub-eltorito.img grub-iso/boot/eltorito.img
cp ../grub/${GRUB_CFG}-legacy.cfg grub-iso/boot/grub/grub.cfg cp ../../grub/${GRUB_CFG}-legacy.cfg grub-iso/boot/grub/grub.cfg
cp $(GRUB_FONT_DIR)/unicode.pf2 grub-iso/boot/grub/fonts/ cp $(GRUB_FONT_DIR)/unicode.pf2 grub-iso/boot/grub/fonts/
cp $(GRUB_LIB_DIR)/i386-pc/*.mod grub-iso/boot/grub/i386-pc/ cp $(GRUB_LIB_DIR)/i386-pc/*.mod grub-iso/boot/grub/i386-pc/
xorrisofs -pad -R -J -volid MT86PLUS_32 -graft-points -hide-rr-moved \ xorrisofs -pad -R -J -volid MT86PLUS_32 -graft-points -hide-rr-moved \

View File

@ -24,7 +24,7 @@ else
MS_LDS=ldscripts/memtest_shared.lds MS_LDS=ldscripts/memtest_shared.lds
endif endif
INC_DIRS = -I../../boot -I../../system -I../../system/loongarch -I../../lib -I../../tests -I../../app -Iapp INC_DIRS = -I../../boot -I../../system -I ../../system/imc -I../../system/loongarch -I../../lib -I../../tests -I../../app -Iapp
SYS_OBJS = system/acpi.o \ SYS_OBJS = system/acpi.o \
system/cpulocal.o \ system/cpulocal.o \
@ -54,7 +54,7 @@ SYS_OBJS = system/acpi.o \
system/loongarch/temperature.o \ system/loongarch/temperature.o \
system/loongarch/vmem.o system/loongarch/vmem.o
IMC_SRCS = $(wildcard ../../system/imc/loongson/*.c) IMC_SRCS = $(wildcard ../../system/imc/loongarch/*.c)
IMC_OBJS = $(subst ../../,,$(IMC_SRCS:.c=.o)) IMC_OBJS = $(subst ../../,,$(IMC_SRCS:.c=.o))
LIB_OBJS = lib/barrier.o \ LIB_OBJS = lib/barrier.o \
@ -130,8 +130,8 @@ system/loongarch/%.o: ../../system/loongarch/%.c
@mkdir -p system/loongarch/ @mkdir -p system/loongarch/
$(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d) $(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d)
system/imc/loongson/%.o: ../../system/imc/loongson/%.c system/imc/loongarch/%.o: ../../system/imc/loongarch/%.c
@mkdir -p system/imc/loongson/ @mkdir -p system/imc/loongarch/
$(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d) $(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d)
lib/%.o: ../../lib/%.c lib/%.o: ../../lib/%.c

View File

@ -25,38 +25,38 @@ else
MS_LDS=ldscripts/memtest_shared.lds MS_LDS=ldscripts/memtest_shared.lds
endif endif
INC_DIRS = -I../boot -I../system -I../lib -I../tests -I../app -Iapp INC_DIRS = -I../../boot -I../../system -I../../system/imc -I../../system/x86 -I../../lib -I../../tests -I../../app -Iapp
SYS_OBJS = system/acpi.o \ SYS_OBJS = system/acpi.o \
system/cpuid.o \
system/cpuinfo.o \
system/cpulocal.o \ system/cpulocal.o \
system/ehci.o \ system/ehci.o \
system/font.o \ system/font.o \
system/heap.o \ system/heap.o \
system/hwctrl.o \
system/hwquirks.o \ system/hwquirks.o \
system/keyboard.o \ system/keyboard.o \
system/ohci.o \ system/ohci.o \
system/memctrl.o \
system/pci.o \ system/pci.o \
system/pmem.o \ system/pmem.o \
system/reloc.o \ system/reloc.o \
system/screen.o \ system/screen.o \
system/serial.o \ system/serial.o \
system/smbios.o \ system/smbios.o \
system/i2c_x86.o \
system/spd.o \ system/spd.o \
system/smp.o \ system/smp.o \
system/temperature.o \
system/timers.o \ system/timers.o \
system/uhci.o \ system/uhci.o \
system/usbhcd.o \ system/usbhcd.o \
system/vmem.o \ system/xhci.o \
system/xhci.o system/x86/cpuid.o \
system/x86/cpuinfo.o \
system/x86/hwctrl.o \
system/x86/i2c.o \
system/x86/memctrl.o \
system/x86/temperature.o \
system/x86/vmem.o
IMC_SRCS = $(wildcard ../system/imc/*.c) IMC_SRCS = $(wildcard ../../system/imc/x86/*.c)
IMC_OBJS = $(subst ../,,$(IMC_SRCS:.c=.o)) IMC_OBJS = $(subst ../../,,$(IMC_SRCS:.c=.o))
LIB_OBJS = lib/barrier.o \ LIB_OBJS = lib/barrier.o \
lib/print.o \ lib/print.o \
@ -79,10 +79,10 @@ APP_OBJS = app/badram.o \
app/config.o \ app/config.o \
app/display.o \ app/display.o \
app/error.o \ app/error.o \
app/interrupt.o \ app/main.o \
app/main.o app/x86/interrupt.o
OBJS = boot/startup.o boot/efisetup.o $(SYS_OBJS) $(IMC_OBJS) $(LIB_OBJS) $(TST_OBJS) $(APP_OBJS) OBJS = boot/x86/startup.o boot/efisetup.o $(SYS_OBJS) $(IMC_OBJS) $(LIB_OBJS) $(TST_OBJS) $(APP_OBJS)
all: mt86plus all: mt86plus
@ -101,49 +101,57 @@ debug: check memtest.debug mt86plus
-include $(subst .o,.d,$(TST_OBJS)) -include $(subst .o,.d,$(TST_OBJS))
-include $(subst .o,.d,$(APP_OBJS)) -include $(subst .o,.d,$(APP_OBJS))
boot/header.o : | ../boot/sbat.csv boot/x86/header.o : | ../../boot/sbat.csv
boot/startup.o: ../boot/startup64.S ../boot/boot.h boot/x86/startup.o: ../../boot/x86/startup64.S ../../boot/boot.h
@mkdir -p boot/x86
$(CC) -m64 -x assembler-with-cpp -c -I../../boot -o $@ $<
boot/%.o: ../../boot/%.S ../../boot/boot.h app/build_version.h
@mkdir -p boot @mkdir -p boot
$(CC) -m64 -x assembler-with-cpp -c -I../boot -o $@ $< $(CC) -m64 -x assembler-with-cpp -c -I../../boot -Iapp -o $@ $<
boot/%.o: ../boot/%.S ../boot/boot.h app/build_version.h boot/efisetup.o: ../../boot/efisetup.c
@mkdir -p boot
$(CC) -m64 -x assembler-with-cpp -c -I../boot -Iapp -o $@ $<
boot/efisetup.o: ../boot/efisetup.c
@mkdir -p boot @mkdir -p boot
$(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d) $(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d)
system/reloc.o: ../system/reloc64.c system/reloc.o: ../../system/reloc64.c
@mkdir -p system @mkdir -p system
$(CC) -c $(CFLAGS) -fno-strict-aliasing $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d) $(CC) -c $(CFLAGS) -fno-strict-aliasing $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d)
system/%.o: ../system/%.c system/%.o: ../../system/%.c
@mkdir -p system @mkdir -p system
$(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d) $(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d)
system/imc/%.o: ../system/imc/%.c system/imc/x86/%.o: ../../system/imc/x86/%.c
@mkdir -p system/imc @mkdir -p system/imc/x86
$(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d) $(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d)
lib/%.o: ../lib/%.c system/x86/%.o: ../../system/x86/%.c
@mkdir -p system/x86
$(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d)
lib/%.o: ../../lib/%.c
@mkdir -p lib @mkdir -p lib
$(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d) $(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d)
tests/%.o: ../tests/%.c tests/%.o: ../../tests/%.c
@mkdir -p tests @mkdir -p tests
$(CC) -c $(CFLAGS) $(OPT_FAST) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d) $(CC) -c $(CFLAGS) $(OPT_FAST) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d)
app/%.o: ../app/%.c app/build_version.h app/%.o: ../../app/%.c app/build_version.h
@mkdir -p app @mkdir -p app
$(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d) $(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d)
app/x86/%.o: ../../app/x86/%.c app/build_version.h
@mkdir -p app/x86
$(CC) -c $(CFLAGS) $(OPT_SMALL) $(INC_DIRS) -o $@ $< -MMD -MP -MT $@ -MF $(@:.o=.d)
app/build_version.h: FORCE app/build_version.h: FORCE
@mkdir -p app @mkdir -p app
@( \ @( \
cp -f ../app/version.h $@.tmp; \ cp -f ../../app/version.h $@.tmp; \
if $(GIT_AVAILABLE) && test -d ../.git ; then \ if $(GIT_AVAILABLE) && test -d ../../.git ; then \
hash=`git rev-parse HEAD | cut -c1-7`; \ hash=`git rev-parse HEAD | cut -c1-7`; \
sed -i 's/GIT_HASH\s\".*"/GIT_HASH "'$$hash'"/' $@.tmp; \ sed -i 's/GIT_HASH\s\".*"/GIT_HASH "'$$hash'"/' $@.tmp; \
else \ else \
@ -170,12 +178,12 @@ memtest.debug: memtest_shared
strip -R .eh_frame memtest_shared strip -R .eh_frame memtest_shared
strip -R .comment memtest_shared strip -R .comment memtest_shared
mt86plus: memtest_shared.bin boot/header.o ldscripts/memtest_efi.lds mt86plus: memtest_shared.bin boot/x86/header.o ldscripts/memtest_efi.lds
$(eval SIZES=$(shell size -B -d memtest_shared | grep memtest_shared)) $(eval SIZES=$(shell size -B -d memtest_shared | grep memtest_shared))
$(LD) --defsym=_bss_size=$(word 3,$(SIZES)) -T ldscripts/memtest_efi.lds boot/header.o -b binary memtest_shared.bin -o mt86plus $(LD) --defsym=_bss_size=$(word 3,$(SIZES)) -T ldscripts/memtest_efi.lds boot/x86/header.o -b binary memtest_shared.bin -o mt86plus
memtest.mbr: memtest_shared.bin boot/mbr.o ldscripts/memtest_mbr.lds memtest.mbr: memtest_shared.bin boot/x86/mbr.o ldscripts/memtest_mbr.lds
$(LD) -T ldscripts/memtest_mbr.lds boot/mbr.o -b binary memtest_shared.bin -o memtest.mbr $(LD) -T ldscripts/memtest_mbr.lds boot/x86/mbr.o -b binary memtest_shared.bin -o memtest.mbr
floppy.img: mt86plus floppy.img: mt86plus
dd if=/dev/zero of=floppy.img bs=1474560 count=1 dd if=/dev/zero of=floppy.img bs=1474560 count=1
@ -234,22 +242,22 @@ grub-eltorito.img:
grub-bootx64.efi: grub-bootx64.efi:
$(GRUB_MKIMAGE) --output $@ --prefix /EFI/BOOT/grub --format x86_64-efi $(GRUB_MODULES) $(GRUB_MKIMAGE) --output $@ --prefix /EFI/BOOT/grub --format x86_64-efi $(GRUB_MODULES)
grub-esp.img: mt86plus grub-bootx64.efi ../grub/${GRUB_CFG}-efi.cfg grub-esp.img: mt86plus grub-bootx64.efi ../../grub/${GRUB_CFG}-efi.cfg
@mkdir -p grub-iso/EFI/BOOT/grub/x86_64-efi grub-iso/EFI/BOOT/grub/fonts @mkdir -p grub-iso/EFI/BOOT/grub/x86_64-efi grub-iso/EFI/BOOT/grub/fonts
cp mt86plus grub-iso/EFI/BOOT/memtest cp mt86plus grub-iso/EFI/BOOT/memtest
cp grub-bootx64.efi grub-iso/EFI/BOOT/bootx64.efi cp grub-bootx64.efi grub-iso/EFI/BOOT/bootx64.efi
cp ../grub/${GRUB_CFG}-efi.cfg grub-iso/EFI/BOOT/grub/grub.cfg cp ../../grub/${GRUB_CFG}-efi.cfg grub-iso/EFI/BOOT/grub/grub.cfg
cp $(GRUB_FONT_DIR)/unicode.pf2 grub-iso/EFI/BOOT/grub/fonts/ cp $(GRUB_FONT_DIR)/unicode.pf2 grub-iso/EFI/BOOT/grub/fonts/
cp $(GRUB_LIB_DIR)/x86_64-efi/*.mod grub-iso/EFI/BOOT/grub/x86_64-efi/ cp $(GRUB_LIB_DIR)/x86_64-efi/*.mod grub-iso/EFI/BOOT/grub/x86_64-efi/
@rm -f grub-esp.img @rm -f grub-esp.img
/sbin/mkdosfs -n MT86P_ESP -F12 -C grub-esp.img 8192 /sbin/mkdosfs -n MT86P_ESP -F12 -C grub-esp.img 8192
mcopy -s -i grub-esp.img grub-iso/EFI :: mcopy -s -i grub-esp.img grub-iso/EFI ::
grub-memtest.iso: mt86plus grub-eltorito.img ../grub/${GRUB_CFG}-legacy.cfg grub-esp.img grub-memtest.iso: mt86plus grub-eltorito.img ../../grub/${GRUB_CFG}-legacy.cfg grub-esp.img
@mkdir -p grub-iso/boot/grub/i386-pc grub-iso/boot/grub/fonts @mkdir -p grub-iso/boot/grub/i386-pc grub-iso/boot/grub/fonts
cp mt86plus grub-iso/boot/memtest cp mt86plus grub-iso/boot/memtest
cp grub-eltorito.img grub-iso/boot/eltorito.img cp grub-eltorito.img grub-iso/boot/eltorito.img
cp ../grub/${GRUB_CFG}-legacy.cfg grub-iso/boot/grub/grub.cfg cp ../../grub/${GRUB_CFG}-legacy.cfg grub-iso/boot/grub/grub.cfg
cp $(GRUB_FONT_DIR)/unicode.pf2 grub-iso/boot/grub/fonts/ cp $(GRUB_FONT_DIR)/unicode.pf2 grub-iso/boot/grub/fonts/
cp $(GRUB_LIB_DIR)/i386-pc/*.mod grub-iso/boot/grub/i386-pc/ cp $(GRUB_LIB_DIR)/i386-pc/*.mod grub-iso/boot/grub/i386-pc/
xorrisofs -pad -R -J -volid MT86PLUS_64 -graft-points -hide-rr-moved \ xorrisofs -pad -R -J -volid MT86PLUS_64 -graft-points -hide-rr-moved \

View File

@ -1,22 +0,0 @@
OUTPUT_FORMAT("binary")
OUTPUT_ARCH("i386")
ENTRY(boot);
SECTIONS {
. = 0;
.bootsect : {
*(.bootsect)
}
.setup : {
*(.setup)
}
.memtest : {
_start = . ;
*(.data)
_end = . ;
}
/DISCARD/ : { *(*) }
_sys_size = (_end - _start + 15) >> 4;
_init_size = (_end - _start) + _bss_size;
}

View File

@ -1,22 +0,0 @@
OUTPUT_FORMAT("binary")
OUTPUT_ARCH(i386:x86-64)
ENTRY(boot);
SECTIONS {
. = 0;
.bootsect : {
*(.bootsect)
}
.setup : {
*(.setup)
}
.memtest : {
_start = . ;
*(.data)
_end = . ;
}
/DISCARD/ : { *(*) }
_sys_size = (_end - _start + 15) >> 4;
_init_size = (_end - _start) + _bss_size;
}