blob: ea9ba0f74ed0492eb6778b3c6735fc8d33b3f5c7 [file] [log] [blame]
# Makefile for MemTest86+
# Author: Chris Brady
# Created: January 1, 1996
# Path for the floppy disk device
AS=as -32
CFLAGS= -Wall -march=i486 -m32 -O0 -fomit-frame-pointer -fno-builtin \
-ffreestanding -fPIC $(SMP_FL) -fno-stack-protector
# This reverts a change introduced with recent binutils (post
# Needed to
# ensure Multiboot header is within the limit offset.
LD += -z max-page-size=0x1000
OBJS= head.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 multiboot.o
all: clean memtest.bin memtest
# Link it statically once so I know I don't have undefined
# symbols and then link it dynamically so I have full
# relocation information
memtest_shared: $(OBJS) Makefile
$(LD) --warn-constructors --warn-common -static -T \
-o $@ $(OBJS) && \
$(LD) -shared -Bsymbolic -T -o $@ $(OBJS)
memtest_shared.bin: memtest_shared
objcopy -O binary $< memtest_shared.bin
memtest: memtest_shared.bin
$(LD) -s -T -b binary memtest_shared.bin -o $@
head.s: head.S config.h defs.h test.h
$(CC) -E -traditional $< -o $@
bootsect.s: bootsect.S config.h defs.h
$(CC) -E -traditional $< -o $@
setup.s: setup.S config.h defs.h
$(CC) -E -traditional $< -o $@
memtest.bin: memtest_shared.bin bootsect.o setup.o
$(LD) -T bootsect.o setup.o -b binary \
memtest_shared.bin -o memtest.bin
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
random.o: random.c
$(CC) -c -Wall -march=i486 -m32 -O3 -fomit-frame-pointer -fno-builtin -ffreestanding random.c
# rule for build number generation
rm -f *.o *.s *.iso memtest.bin memtest memtest_shared \
memtest_shared.bin memtest.iso
make all
install: all
dd <memtest.bin >$(FDISK) bs=8192
dd <precomp.bin >$(FDISK) bs=8192
dos: all
cat mt86+_loader memtest.bin > memtest.exe