From e548e79578d692dce885e7ef3cb38d993e90e07f Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 22 Apr 2024 08:19:02 +0200 Subject: MHR-5: A new part of the porting has been done. - Separate makefiles for each targets. - New Toolbox calls as well. - Check for platform to deduce __kernelDispatchCall. Signed-off-by: Amlal El Mahrouss --- Private/Drivers/MahroussUpdate/makefile | 53 -------------------------------- Private/Drivers/MahroussUpdate/x86_64.mk | 53 ++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 53 deletions(-) delete mode 100644 Private/Drivers/MahroussUpdate/makefile create mode 100644 Private/Drivers/MahroussUpdate/x86_64.mk (limited to 'Private/Drivers/MahroussUpdate') diff --git a/Private/Drivers/MahroussUpdate/makefile b/Private/Drivers/MahroussUpdate/makefile deleted file mode 100644 index a0673a23..00000000 --- a/Private/Drivers/MahroussUpdate/makefile +++ /dev/null @@ -1,53 +0,0 @@ -################################################## -# (C) Mahrouss Logic, all rights reserved. -# This is the sample driver makefile. -################################################## - -CC_GNU=x86_64-w64-mingw32-gcc -LD_GNU=x86_64-w64-mingw32-ld - -WINDRES=x86_64-w64-mingw32-windres - -ADD_FILE=touch -COPY=cp -HTTP_GET=wget - -LD_FLAGS=-e __ImageStart --subsystem=17 - -OBJ=*.o - - -REM=rm -REM_FLAG=-f - -FLAG_ASM=-f win64 -FLAG_GNU=-fshort-wchar -D__EFI_x86_64__ -mgeneral-regs-only -mno-red-zone -D__KERNEL__ -DEFI_FUNCTION_WRAPPER -I../ -I../../ -I./ -c -ffreestanding -D__HAVE_MAHROUSS_APIS__ -D__MAHROUSS__ -D__BOOTLOADER__ -I./ - -.PHONY: invalid-recipe -invalid-recipe: - @echo "invalid-recipe: Use make all instead." - -.PHONY: all -all: compile-amd64 - $(LD_GNU) $(OBJ) $(LD_FLAGS) -o MahroussUpdate.exe - cp MahroussUpdate.exe ../../Root/Boot/MahroussUpdate.exe - -ifneq ($(DEBUG_SUPPORT), ) -DEBUG = -D__DEBUG__ -endif - -.PHONY: compile-amd64 -compile-amd64: - $(WINDRES) DriverRsrc.rsrc -O coff -o DriverRsrc.o - $(CC_GNU) $(FLAG_GNU) -std=c17 $(DEBUG) $(wildcard *.c) $(wildcard ../../DriverKit/*.c) $(wildcard ../../DriverKit/*.s) - $(CC_GNU) $(FLAG_GNU) -std=c++17 -fno-rtti -fno-exceptions $(DEBUG) $(wildcard *.cc) $(wildcard ../../DriverKit/*.cc) - -.PHONY: clean -clean: - $(REM) $(REM_FLAG) $(OBJ) MahroussUpdate.exe - -.PHONY: help -help: - @echo "=== HELP ===" - @echo "clean: Clean driver." - @echo "compile-amd64: Build driver." diff --git a/Private/Drivers/MahroussUpdate/x86_64.mk b/Private/Drivers/MahroussUpdate/x86_64.mk new file mode 100644 index 00000000..cffa0ab7 --- /dev/null +++ b/Private/Drivers/MahroussUpdate/x86_64.mk @@ -0,0 +1,53 @@ +################################################## +# (C) Mahrouss Logic, all rights reserved. +# This is the sample driver makefile. +################################################## + +CC_GNU=x86_64-w64-mingw32-gcc +LD_GNU=x86_64-w64-mingw32-ld + +WINDRES=x86_64-w64-mingw32-windres + +ADD_FILE=touch +COPY=cp +HTTP_GET=wget + +LD_FLAGS=-e __ImageStart --subsystem=17 + +OBJ=*.o + + +REM=rm +REM_FLAG=-f + +FLAG_ASM=-f win64 +FLAG_GNU=-fshort-wchar -D__EFI_x86_64__ -mgeneral-regs-only -mno-red-zone -D__KERNEL__ -DEFI_FUNCTION_WRAPPER -I../ -I../../ -I./ -c -ffreestanding -D__HAVE_MAHROUSS_APIS__ -D__MAHROUSS__ -D__BOOTLOADER__ -I./ + +.PHONY: invalid-recipe +invalid-recipe: + @echo "invalid-recipe: Use make all instead." + +.PHONY: all +all: compile-amd64 + $(LD_GNU) $(OBJ) $(LD_FLAGS) -o MahroussUpdate.exe + cp MahroussUpdate.exe ../../Root/Boot/MahroussUpdate.exe + +ifneq ($(DEBUG_SUPPORT), ) +DEBUG = -D__DEBUG__ +endif + +.PHONY: compile-amd64 +compile-amd64: + $(WINDRES) DriverRsrc.rsrc -O coff -o DriverRsrc.o + $(CC_GNU) $(FLAG_GNU) -std=c17 $(DEBUG) $(wildcard *.c) $(wildcard ../../DriverKit/*.c) $(wildcard ../../DriverKit/*.S) + $(CC_GNU) $(FLAG_GNU) -std=c++17 -fno-rtti -fno-exceptions $(DEBUG) $(wildcard *.cc) $(wildcard ../../DriverKit/*.cc) + +.PHONY: clean +clean: + $(REM) $(REM_FLAG) $(OBJ) MahroussUpdate.exe + +.PHONY: help +help: + @echo "=== HELP ===" + @echo "clean: Clean driver." + @echo "compile-amd64: Build driver." -- cgit v1.2.3