Skip to content
Permalink
Browse files

とりまubuntu14.04 x64でmakeできるようにした

  • Loading branch information
planset committed Apr 8, 2016
1 parent 8f3135c commit e708f232e5e3d0099fdee76e32aa8f1d5bfac656
Showing with 8 additions and 6 deletions.
  1. +1 −1 Makefile
  2. +3 −2 apps/Makefile
  3. +2 −2 boot/Makefile
  4. +2 −1 kernel/Makefile
@@ -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
@@ -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 $@ $<
@@ -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

@@ -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

@@ -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

0 comments on commit e708f23

Please sign in to comment.
You can’t perform that action at this time.