-CFLAGS=-I../include
+CC=gcc
+CFLAGS=-I../include -I../include/raw -nostdlib -nostdinc -fno-builtin -D__RAW__ -Wall -Werror -pedantic -ansi -std=gnu99
+OBJS=counter.o firstrun.o ../pci/pci-raw.o ../lib/minilib.o ../lib/console.o ../ich2/smram-ich2.o vga-overlay.o
all: aseg.elf
-aseg.bin: aseg.asm
- nasm -o aseg.bin aseg.asm
+aseg.elf: aseg.lds aseg.o $(OBJS)
+ ld -o aseg.elf -T aseg.lds $(OBJS)
-aseg.o: aseg.bin
- objcopy -I binary -B i386 -O elf32-i386 aseg.bin aseg.o
+clean:
+ rm -f $(OBJS) aseg.elf aseg.bin aseg.o
-aseg.elf: aseg.o aseg.lds counter.o ../pci/pci-smm.o
- ld -o aseg.elf -T aseg.lds counter.o ../pci/pci-smm.o
+
+%.o: %.asm
+ nasm -o $@.bin $<
+ objcopy -I binary -B i386 -O elf32-i386 $@.bin $@
+ rm -f $@.bin