metalsvm/tools/Makefile
2011-02-16 15:27:21 +01:00

50 lines
1.1 KiB
Makefile

MAKE = make
CC = gcc
CROSS_COMPILE=i386-unknown-linux-gnu-gcc
CFLAGS = -m32 -O2 -Wall
LDFLGAS =
DEFINES=
NASM = nasm
NASMFLAGS = -fbin
EXECFILES = $(shell find ../newlib/examples -executable -type f)
# other implicit rules
%.o : %.c
$(CC) -c $(CFLAGS) -o $@ $<
default: all
all: make_initrd
./make_initrd /bin $(foreach FILE, $(EXECFILES), $(FILE) $(shell basename $(FILE)))
make_initrd: make_initrd.o
$(CC) $(CFLAGS) -o make_initrd $< $(LDFLAGS)
smp_setup.bin: smp_setup.asm
$(ASM) $(ASMFLAGS) -o $@ $<
smp_setup.hex: smp_setup.bin
hexdump -v -e '"0x" 1/1 "%02X" ", "' $< > $@
scc_setup.bin: scc_setup.asm
$(NASM) $(NASMFLAGS) -o $@ $<
reset_vector.bin: reset_vector.o
ld --oformat binary -Ttext 0 -melf_i386 -o $@ $<
SCC: scc_setup.bin reset_vector.bin
cp ../metalsvm.bin ./metalsvm.elf
objcopy -O binary metalsvm.elf metalsvm.bin
chmod a-x *.bin
. ./prepare.sh
/home/lankes/tools/bin2obj -m load.map -o metalsvm.obj
sccMerge -noimage -m 8 -n 12 -force ./metalsvm.mt
clean:
$(RM) -rf *.o *~ make_initrd *.bin *.obj *.hex *.elf obj
depend:
$(CC) -MM $(CFLAGS) *.c > Makefile.dep
-include Makefile.dep
# DO NOT DELETE