Skip to content

Commit

Permalink
Re-organize C sources and build process
Browse files Browse the repository at this point in the history
  • Loading branch information
dalnefre committed Jul 14, 2014
1 parent a629b17 commit 87a0ea7
Show file tree
Hide file tree
Showing 9 changed files with 545 additions and 379 deletions.
21 changes: 14 additions & 7 deletions Makefile
Expand Up @@ -2,26 +2,33 @@
# Makefile for pijFORTHos -- Raspberry Pi JonesFORTH Operating System
#

COPTS = -g -Wall -O2 -nostdlib -nostartfiles -ffreestanding
AS= as
CC= gcc -g -Wall -O2 -nostdlib -nostartfiles -ffreestanding
LD= ld

KOBJS= start.o jonesforth.o raspberry.o timer.o serial.o xmodem.o

all: kernel.img

start.o: start.s
as start.s -o start.o
$(AS) start.s -o start.o

jonesforth.o: jonesforth.s
as jonesforth.s -o jonesforth.o
$(AS) jonesforth.s -o jonesforth.o

raspberry.o: raspberry.c
gcc $(COPTS) -c raspberry.c -o raspberry.o
#raspberry.o: raspberry.c
# $(CC) -c raspberry.c -o raspberry.o

kernel.img: loadmap start.o jonesforth.o raspberry.o
ld start.o jonesforth.o raspberry.o -T loadmap -o pijFORTHos.elf
kernel.img: loadmap $(KOBJS)
$(LD) $(KOBJS) -T loadmap -o pijFORTHos.elf
objdump -D pijFORTHos.elf > pijFORTHos.list
objcopy pijFORTHos.elf -O ihex pijFORTHos.hex
objcopy --only-keep-debug pijFORTHos.elf kernel.sym
objcopy pijFORTHos.elf -O binary kernel.img

.c.o:
$(CC) -c $<

clean:
rm -f *.o
rm -f *.bin
Expand Down

0 comments on commit 87a0ea7

Please sign in to comment.