Skip to content

Commit

Permalink
とりまubuntu14.04 x64でmakeできるようにした
Browse files Browse the repository at this point in the history
  • Loading branch information
planset committed Apr 8, 2016
1 parent 8f3135c commit e708f23
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ clean:
rm -f *~ *.o *.bin *.dat *.img *.map

run: fd.img
qemu -fda $<
qemu-system-i386 -fda $<

FORCE:
.PHONY: clean FORCE
5 changes: 3 additions & 2 deletions apps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ KERNEL_PATH = ../kernel
CFLAGS = -Wall -Wextra
CFLAGS += -nostdinc -nostdlib -fno-builtin -c
CFLAGS += -Iinclude -I$(KERNEL_PATH)/include
CFLAGS += -m32

.c.o:
gcc $(CFLAGS) -o $@ $<
Expand All @@ -11,11 +12,11 @@ apps.img: bin/shell bin/uptime

bin/shell: shell.o
[ -d bin ] || mkdir bin
ld -o $@ $< -Map shell.map -s -T app.ld -x
ld -m elf_i386 -o $@ $< -Map shell.map -s -T app.ld -x

bin/uptime: uptime.o
[ -d bin ] || mkdir bin
ld -o $@ $< -Map uptime.map -s -T app.ld -x
ld -m elf_i386 -o $@ $< -Map uptime.map -s -T app.ld -x

shell.o: shell.c

Expand Down
4 changes: 2 additions & 2 deletions boot/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.s.o:
as -o $@ $<
as --32 -o $@ $<

boot.bin: boot.o
ld -o $@ $< -T boot.ld -Map boot.map
ld -m elf_i386 -o $@ $< -T boot.ld -Map boot.map

boot.o: boot.s

Expand Down
3 changes: 2 additions & 1 deletion kernel/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
CFLAGS = -Wall -Wextra
CFLAGS += -nostdinc -nostdlib -fno-builtin -c
CFLAGS += -Iinclude
CFLAGS += -m32

.S.o:
gcc $(CFLAGS) -o $@ $<
.c.o:
gcc $(CFLAGS) -o $@ $<

kernel.bin: sys.o cpu.o intr.o excp.o memory.o sched.o fs.o task.o syscall.o lock.o timer.o console_io.o queue.o common.o debug.o init.o kern_task_init.o
ld -o $@ $+ -Map System.map -s -T sys.ld -x
ld -m elf_i386 -o $@ $+ -Map System.map -s -T sys.ld -x

sys.o: sys.S
cpu.o: cpu.c
Expand Down

0 comments on commit e708f23

Please sign in to comment.