summaryrefslogtreecommitdiffstats
path: root/efi_memtest/Makefile
diff options
context:
space:
mode:
authorRegina König2020-07-26 19:19:33 +0200
committerRegina König2020-07-26 19:19:33 +0200
commit6144a41ecae7ee90d398649c0acf3f30e2639e18 (patch)
treeaa533965545b131b94a9132ce9ff11ad18915c44 /efi_memtest/Makefile
parentstill creating Makefile (diff)
downloadmemtest86-6144a41ecae7ee90d398649c0acf3f30e2639e18.tar.gz
memtest86-6144a41ecae7ee90d398649c0acf3f30e2639e18.tar.xz
memtest86-6144a41ecae7ee90d398649c0acf3f30e2639e18.zip
Makefile seems to be correct
Diffstat (limited to 'efi_memtest/Makefile')
-rw-r--r--efi_memtest/Makefile50
1 files changed, 27 insertions, 23 deletions
diff --git a/efi_memtest/Makefile b/efi_memtest/Makefile
index 8b50ac9..e8489aa 100644
--- a/efi_memtest/Makefile
+++ b/efi_memtest/Makefile
@@ -18,6 +18,8 @@ M64=-m64 -mcmodel=small
M32=-m32
+M=$(M64)
+
PREPROCESSOR=-DUEFI -DUSING_LTO -Os \
-D DISABLE_NEW_DEPRECATED_INTERFACES "-DEFIAPI=__attribute__((ms_abi))"
@@ -39,57 +41,59 @@ OBJS=AutoGen.obj main.o test.o smp.o config.o screen_buffer.o lib.o init.o cont
# libs/UefiMemoryAllocationLib.lib libs/UefiRuntimeServicesTableLib.lib
# libs/UefiDevicePathLib.lib libs/UefiApplicationEntryPoint.lib libs/UefiLib.lib
-# all: clean MemtestEfi move run
+all: clean MemtestEfi.efi
-# $(MAIN_FILE): $(MAIN_FILE).dll
-# ./Include/GenFw -e UEFI_APPLICATION -o OUTPUT/$MAIN_FILE.efi OUTPUT/$MAIN_FILE.dll
+$(MAIN_FILE).efi: $(MAIN_FILE).dll
+ ./Include/GenFw -e UEFI_APPLICATION -o OUTPUT/$MAIN_FILE.efi OUTPUT/$MAIN_FILE.dll
-# $(Main_FILE).dll: $(MAIN_FILE).lib
-# $(CC) $(CFLAGS) -o OUTPUT/$MAIN_FILE.dll \
-# -nostdlib \
-# -Wl,-n,-q,--gc-sections \
-# -Wl,--entry,_ModuleEntryPoint \
-# -Wl,-Map,OUTPUT/$MAIN_FILE.map,--whole-archive \
-# -Wl,-melf_x86_64,--oformat=elf64-x86-64,-pie \
-# -Wl,--start-group,@static_library_files.lst,--end-group \
-# -Wl,--defsym=PECOFF_HEADER_SIZE=0x228 \
-# -Wl,--script=Include/GccBase.lds \
-# -z common-page-size=0x40 \
-# -u _ModuleEntryPoint \
-# -DSTRING_ARRAY_NAME=${MAIN_FILE}Strings \
-# -I OUTPUT/ \
-# -I Library/
-# objcopy --strip-unneeded -R .eh_frame -v OUTPUT/$MAIN_FILE.dll OUTPUT/$MAIN_FILE.dll
+$(MAIN_FILE).dll: $(MAIN_FILE).lib
+ $(CC) $(CFLAGS) $(PREPROCESSOR) $(M)-o $(MAIN_FILE).dll \
+ -nostdlib \
+ -Wl,-n,-q,--gc-sections \
+ -Wl,--entry,_ModuleEntryPoint \
+ -Wl,-Map,OUTPUT/$MAIN_FILE.map,--whole-archive \
+ -Wl,-melf_x86_64,--oformat=elf64-x86-64,-pie \
+ -Wl,--start-group,@static_library_files.lst,--end-group \
+ -Wl,--defsym=PECOFF_HEADER_SIZE=0x228 \
+ -Wl,--script=Include/GccBase.lds \
+ -z common-page-size=0x40 \
+ -u _ModuleEntryPoint \
+ -DSTRING_ARRAY_NAME=${MAIN_FILE}Strings \
+ -I OUTPUT/ \
+ -I Library/
+ objcopy --strip-unneeded -R .eh_frame -v OUTPUT/$MAIN_FILE.dll OUTPUT/$MAIN_FILE.dll
$(MAIN_FILE).lib: $(OBJS)
gcc-ar crv OUTPUT/$(MAIN_FILE).lib $(OBJS)
$(MAIN_FILE).obj: $(MAIN_FILE).c
- $(CC) $(CFLAGS) $(PREPROCESSOR) $(M32) -o $(MAIN_FILE).obj \
+ $(CC) $(CFLAGS) $(PREPROCESSOR) $(M) -o $(MAIN_FILE).obj \
-MMD -MF OUTPUT/$(MAIN_FILE).obj.deps \
-c \
+ -include memtest86+/efi/Include/AutoGen.h \
-DSTRING_ARRAY_NAME=${MAIN_FILE}Strings \
-I . \
+ -I"memtest86+" \
-I"memtest86+/efi/Include" \
$(MAIN_FILE).c
AutoGen.obj: memtest86+/efi/Include/AutoGen.c
- $(CC) $(CFLAGS) $(PREPROCESSOR) $(M32) -o AutoGen.obj \
+ $(CC) $(CFLAGS) $(PREPROCESSOR) $(M) -o AutoGen.obj \
-c \
-I .\
-I"memtest86+/efi/Include" \
memtest86+/efi/Include/AutoGen.c
%.o: memtest86+/%.c
- $(CC) $(CFLAGS) $(PREPROCESSOR) $(M32) -c -o $@ $<
+ $(CC) $(CFLAGS) $(PREPROCESSOR) $(M) -c -o $@ $<
clean:
rm -f OUTPUT/*
rm -f memtest86+/*.o
rm -f *.o
- rm -f *.obj
+ rm -f MemtestEfi.obj
# move: