summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile40
1 files changed, 24 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index eb5fedb..d6e938c 100644
--- a/Makefile
+++ b/Makefile
@@ -12,16 +12,21 @@ FDISK=/dev/fd0
AS=as -32
CC=gcc
-CFLAGS= -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin \
- -ffreestanding -fPIC $(SMP_FL) -fno-stack-protector
-
+CFLAGS= -Wall -Werror -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin \
+ -ffreestanding -fPIC $(SMP_FL) -fno-stack-protector
+
+SELF_TEST_CFLAGS = -Wall -Werror -march=i486 -m32 -O1 -g
OBJS= head.o exit.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \
- config.o cpuid.o linuxbios.o pci.o memsize.o spd.o error.o dmi.o controller.o \
- smp.o vmem.o random.o
-
+ config.o cpuid.o linuxbios.o pci.o spd.o error.o dmi.o controller.o \
+ smp.o vmem.o memsize.o random.o
+
+SELF_TEST_OBJS = test.o self_test.o cpuid.o random.o
all: memtest.bin memtest memtest.0
+run_self_test : self_test
+ ./self_test && touch run_self_test
+
# Link it statically once so I know I don't have undefined
# symbols and then link it dynamically so I have full
# relocation information
@@ -36,6 +41,9 @@ memtest_shared.bin: memtest_shared
memtest: memtest_shared.bin memtest.lds
$(LD) -s -T memtest.lds -b binary memtest_shared.bin -o $@
+self_test : $(SELF_TEST_OBJS)
+ $(CC) $(SELF_TEST_CFLAGS) -o $@ $(SELF_TEST_OBJS)
+
head.s: head.S config.h defs.h test.h
$(CC) -E -traditional $< -o $@
@@ -55,26 +63,23 @@ memtest.bin: memtest_shared.bin bootsect.o setup.o memtest.bin.lds
$(LD) -T memtest.bin.lds bootsect.o setup.o -b binary \
memtest_shared.bin -o memtest.bin
+self_test.o : self_test.c
+ $(CC) -c $(SELF_TEST_CFLAGS) self_test.c
+
memtest.0: memtest_shared.bin pxe.o setup.o memtest.bin.lds
$(LD) -T memtest.bin.lds pxe.o setup.o -b binary \
memtest_shared.bin -o memtest.0
-reloc.o: reloc.c
- $(CC) -c $(CFLAGS) -fno-strict-aliasing reloc.c
-test.o: test.c
- $(CC) -c -Wall -march=i486 -m32 -O0 -fomit-frame-pointer -fno-builtin -ffreestanding test.c
+memsize.o: memsize.c
+ $(CC) -Wall -Werror -march=i486 -m32 -O0 -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC $(SMP_FL) -fno-stack-protector -c -o memsize.o memsize.c
random.o: random.c
$(CC) -c -Wall -march=i486 -m32 -O3 -fomit-frame-pointer -fno-builtin -ffreestanding random.c
-
-# rule for build number generation
-build_number:
- sh make_buildnum.sh
clean:
rm -f *.o *.s *.iso memtest.bin memtest memtest_shared \
- memtest_shared.bin memtest.iso memtest.0
+ memtest_shared.bin memtest.iso run_self_test self_test memtest.0
iso:
make all
@@ -85,6 +90,9 @@ install: all
install-precomp:
dd <precomp.bin >$(FDISK) bs=8192
-
+
dos: all
cat mt86+_loader memtest.bin > memtest.exe
+
+debug2pxe: all
+ cp memtest.bin /srv/tftp/memtest/memtest