Created
December 5, 2011 04:28
-
-
Save ahamid/1432300 to your computer and use it in GitHub Desktop.
Makefile with ld flags
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
objects = ../../../mk/kimg.o cpu-arch.o scr-print.o | |
fill = ../../../utils/fill | |
cpu_objects = main.o task.o pgrequest.o descriptor.o thread.o tss.o interrupt.o paging.o memory.o cpu-asm.o syscall-gates.o int.o pic.o state_switch.o stack_winding.o caps.o permissions.o ttrace.o | |
prt_objects = print.o vga.o | |
dependencies = main.d task.d descriptor.d thread.d tss.d interrupt.d paging.d memory.d print.d caps.d permissions.d ttrace.d | |
CPPFLAGS += -I"../../../include/" -I"../include" | |
%.d : %.c | |
@echo making deps for $< ... | |
@gcc -E -MD $(CPPFLAGS) $< > /dev/null | |
all : kimg | |
kimg : $(objects) | |
$(LD) $(LDFLAGS) $(objects) --oformat binary -Ttext 0x100000 -e 0x100000 -Map kernel.map -o kimg | |
$(fill) kimg -m 512 | |
#Checking Kernel size... (less than 0xF0000 | |
../size.sh | |
kelf : $(objects) | |
$(LD) $(LDFLAGS) $(objects) -o kelf | |
cpu-arch.o : $(cpu_objects) | |
$(LD) $(LDFLAGS) -i $(cpu_objects) -o cpu-arch.o | |
scr-print.o : $(prt_objects) | |
$(LD) $(LDFLAGS) -i $(prt_objects) -o scr-print.o | |
.PHONY : clean | |
clean : | |
rm -f *.o *.d *.map kimg kelf zeros | |
rm -f *~ | |
.PHONY : dep | |
dep : $(dependencies) | |
ifeq ($(filter clean dep,$(MAKECMDGOALS)), ) | |
include $(dependencies) | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment