Demo entry 2312250

larx makefile

   

Submitted by pr on Jul 22, 2015 at 15:18
Language: Makefile. Code size: 929 Bytes.

#makefile for kernel testing. Just for fun ;)
AS 	=as
LD	=ld
CC      =gcc-2.95
CPP     =gcc-2.95 -E -nostdinc 
CFLAGS  = -O2 -nostdinc -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i386 -Iinclude -D_LARX_
LDFLAGS = -m elf_i386 -s -x -M -Ttext 0x2000 -e start32 --oformat binary
OBJ = start32.o main.o setups.o printk.o vsprintf.o cos.o

.c.s:
	$(CC) $(CFLAGS) \
	-nostdinc -S -o $*.s $<
.s.o:
	$(AS)  -o $*.o $<
.c.o:
	$(CC) $(CFLAGS) \
	-c -o $*.o $<
					
system:	boot $(OBJ)
	ld -Ttext 0x0 -s --oformat binary -o boot boot.o
	$(LD) $(LDFLAGS) -o kernel $(OBJ) > Sys.map
	$(LD) -Ttext 0x2000 -e start32 $(OBJ) -o debug.img
	cat boot >  system
	cat kernel >> system

boot:	boot.o
	ld -Ttext 0x0 -s --oformat binary -o boot boot.o
clean:
	rm system boot kernel *.o

f:	system
	dd if=system of=/dev/fd0

b:	boot.asm
	nasm boot.asm -o boot
	cat kernel >> boot
	cat boot > /dev/fd0

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).