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/SampleDriver/makefile | 52 ---------------------------------- Private/Drivers/SampleDriver/x86_64.mk | 52 ++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 52 deletions(-) delete mode 100644 Private/Drivers/SampleDriver/makefile create mode 100644 Private/Drivers/SampleDriver/x86_64.mk (limited to 'Private/Drivers/SampleDriver') diff --git a/Private/Drivers/SampleDriver/makefile b/Private/Drivers/SampleDriver/makefile deleted file mode 100644 index cc96c022..00000000 --- a/Private/Drivers/SampleDriver/makefile +++ /dev/null @@ -1,52 +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 -std=c17 -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 SampleDriver.exe - cp SampleDriver.exe ../../Root/Boot/SampleDriver.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) $(DEBUG) $(wildcard *.c) $(wildcard ../../DriverKit/*.c) $(wildcard ../../DriverKit/*.s) - -.PHONY: clean -clean: - $(REM) $(REM_FLAG) $(OBJ) SampleDriver.exe - -.PHONY: help -help: - @echo "=== HELP ===" - @echo "clean: Clean driver." - @echo "compile-amd64: Build driver." diff --git a/Private/Drivers/SampleDriver/x86_64.mk b/Private/Drivers/SampleDriver/x86_64.mk new file mode 100644 index 00000000..f8d56b08 --- /dev/null +++ b/Private/Drivers/SampleDriver/x86_64.mk @@ -0,0 +1,52 @@ +################################################## +# (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 -std=c17 -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 SampleDriver.exe + cp SampleDriver.exe ../../Root/Boot/SampleDriver.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) $(DEBUG) $(wildcard *.c) $(wildcard ../../DriverKit/*.c) $(wildcard ../../DriverKit/*.S) + +.PHONY: clean +clean: + $(REM) $(REM_FLAG) $(OBJ) SampleDriver.exe + +.PHONY: help +help: + @echo "=== HELP ===" + @echo "clean: Clean driver." + @echo "compile-amd64: Build driver." -- cgit v1.2.3