CC = i686-elf-gcc LD = i686-elf-ld CFLAGS = -ffreestanding -O2 -Wall -Wextra -ffunction-sections -fdata-sections -I../rocklibc/include LDFLAGS = -m elf_i386 -nostdlib --gc-sections TARGET = origin.elf all: $(TARGET) crt0.o: crt0.s $(CC) $(CFLAGS) -c crt0.s -o crt0.o main.o: main.c $(CC) $(CFLAGS) -c main.c -o main.o $(TARGET): crt0.o main.o ../rocklibc/rlibc.a $(LD) $(LDFLAGS) -T linker.ld crt0.o main.o ../rocklibc/rlibc.a $(shell $(CC) -print-libgcc-file-name) -o $(TARGET) cp $(TARGET) ../initrd clean: rm -f *.o $(TARGET) .PHONY: all clean