Makefile 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # Makefile for MemTest86+
  2. #
  3. # Author: Chris Brady
  4. # Created: January 1, 1996
  5. #
  6. # Path for the floppy disk device
  7. #
  8. FDISK=/dev/fd0
  9. AS=as -32
  10. CC=gcc
  11. CFLAGS= -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin \
  12. -ffreestanding -fPIC $(SMP_FL) -fno-stack-protector
  13. OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \
  14. config.o cpuid.o linuxbios.o pci.o memsize.o spd.o error.o dmi.o controller.o \
  15. smp.o vmem.o random.o
  16. all: clean memtest.bin memtest
  17. # scp memtest.bin root@192.168.0.12:/srv/tftp/mt86plus
  18. # Link it statically once so I know I don't have undefined
  19. # symbols and then link it dynamically so I have full
  20. # relocation information
  21. memtest_shared: $(OBJS) memtest_shared.lds Makefile
  22. $(LD) --warn-constructors --warn-common -static -T memtest_shared.lds \
  23. -o $@ $(OBJS) && \
  24. $(LD) -shared -Bsymbolic -T memtest_shared.lds -o $@ $(OBJS)
  25. memtest_shared.bin: memtest_shared
  26. objcopy -O binary $< memtest_shared.bin
  27. memtest: memtest_shared.bin memtest.lds
  28. $(LD) -s -T memtest.lds -b binary memtest_shared.bin -o $@
  29. head.s: head.S config.h defs.h test.h
  30. $(CC) -E -traditional $< -o $@
  31. bootsect.s: bootsect.S config.h defs.h
  32. $(CC) -E -traditional $< -o $@
  33. setup.s: setup.S config.h defs.h
  34. $(CC) -E -traditional $< -o $@
  35. memtest.bin: memtest_shared.bin bootsect.o setup.o memtest.bin.lds
  36. $(LD) -T memtest.bin.lds bootsect.o setup.o -b binary \
  37. memtest_shared.bin -o memtest.bin
  38. reloc.o: reloc.c
  39. $(CC) -c $(CFLAGS) -fno-strict-aliasing reloc.c
  40. test.o: test.c
  41. $(CC) -c -Wall -march=i486 -m32 -O0 -fomit-frame-pointer -fno-builtin -ffreestanding test.c
  42. random.o: random.c
  43. $(CC) -c -Wall -march=i486 -m32 -O3 -fomit-frame-pointer -fno-builtin -ffreestanding random.c
  44. # rule for build number generation
  45. build_number:
  46. sh make_buildnum.sh
  47. clean:
  48. rm -f *.o *.s *.iso memtest.bin memtest memtest_shared \
  49. memtest_shared.bin memtest.iso
  50. iso:
  51. make all
  52. ./makeiso.sh
  53. install: all
  54. dd <memtest.bin >$(FDISK) bs=8192
  55. install-precomp:
  56. dd <precomp.bin >$(FDISK) bs=8192
  57. dos: all
  58. cat mt86+_loader memtest.bin > memtest.exe