modify include lines and Makefiles

This commit is contained in:
Tomoki Shirasawa
2012-12-17 16:10:56 +09:00
parent 6ff27458f4
commit 0a808057eb
47 changed files with 139 additions and 135 deletions

View File

@@ -1,28 +1,29 @@
CFLAGS=-c -Wall -O
CFLAGS_TEST=-DTEST
all: elfboot elfboot_test
all: elfboot
elfboot: elfboot.bin
cp $^ $@
truncate -s $(shell expr '(' `stat -c '%s' $^` + 4095 ')' / 4096 '*' 4096) $@
elfboot.bin: elfboot.elf
objcopy -O binary $^ $@
$(OBJCOPY) -O binary $^ $@
elfboot.elf: head.o elfboot.raw.o raw.lds
ld $(LDFLAGS_RAW) -T raw.lds -o $@ $^
$(LD) $(LDFLAGS_RAW) -T raw.lds -o $@ $^
elfboot_test: elfboot.test.o test_main.o
gcc $(LDFLAGS) -o $@ $^
$(CC) -o $@ $^
elfboot.raw.o: elfboot.c
gcc $(CFLAGS) -o $@ $^
$(CC) $(CFLAGS) -o $@ $^
elfboot.test.o: elfboot.c
gcc $(CFLAGS) $(CFLAGS_TEST) -o $@ $^
$(CC) $(CFLAGS) $(CFLAGS_TEST) -o $@ $^
clean:
$(RM) elfboot *.bin *.elf elfboot_test *.o
disas:
objdump -b binary -m i386:x86-64 -D elfboot.bin
$(OBJDUMP) -b binary -m i386:x86-64 -D elfboot.bin