## This is Architecture independant part of the makefile makedefine CC:=gcc makedefine CPP:= gcc -x assembler-with-cpp -DASSEMBLY -E makedefine LIBGCC_FILE_NAME := $(shell $(CC) -print-libgcc-file-name) makedefine GCC_INC_DIR := $(shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp") makedefine CPPFLAGS := -I$(TOP)/src/include -I$(TOP)/src/arch/$(ARCH)/include -I$(GCC_INC_DIR) $(CPUFLAGS) makedefine CFLAGS := $(CPU_OPT) $(CPPFLAGS) -Os -nostdinc -nostdlib -fno-builtin -Wall makerule ldscript.ld : ldoptions $(LDSUBSCRIPTS-1) ; echo "INCLUDE ldoptions" > $@ ; for file in $(LDSUBSCRIPTS-1) ; do echo "INCLUDE $$file" >> $@ ; done makerule cpuflags : Makefile.settings ; perl -e 'print "CPUFLAGS :=\n"; foreach $$var (split(" ", $$ENV{VARIABLES})) { if (exists($$ENV{$$var})) { print "CPUFLAGS += -D$$var" . (length($$ENV{$$var})?"=\x27$$ENV{$$var}\x27":"") ."\n"} else { print "CPUFLAGS += -U$$var\n"} }' > $@ makerule ldoptions : Makefile.settings ; perl -e 'foreach $$var (split(" ", $$ENV{VARIABLES})) { if ($$ENV{$$var} =~ m/^(0x[0-9a-fA-F]+|0[0-7]+|[0-9]+)$$/) { print "$$var = $$ENV{$$var};\n"; }}' > $@ makerule linuxbios.strip: linuxbios ; objcopy -O binary linuxbios linuxbios.strip makerule linuxbios.o : crt0.o $(DRIVERS-1) linuxbios.a $(LIBGCC_FILE_NAME) ; $(CC) -nostdlib -r -o $@ crt0.o $(DRIVERS-1) linuxbios.a $(LIBGCC_FILE_NAME) makerule linuxbios: linuxbios.o ldscript.ld ; $(CC) -nostdlib -nostartfiles -static -o $@ -T ldscript.ld linuxbios.o addaction linuxbios nm -n linuxbios > linuxbios.map makerule linuxbios.a : $(OBJECTS-1) ; rm -f linuxbios.a addaction linuxbios.a ar cr linuxbios.a $(OBJECTS-1) option CRT0=$(TOP)/src/arch/$(ARCH)/config/crt0.base makerule crt0.S: $(CRT0) ; cp $< $@ makerule crt0.s: crt0.S crt0_includes.h $(CRT0_INCLUDES); @echo "$(CPP) ... $< > $@ " addaction crt0.s @$(CPP) $(CPPFLAGS) -I$(TOP)/src $< > $@.new && mv $@.new $@ makerule crt0.o : crt0.s; @echo $(CC) ... -o $@ $< addaction crt0.o @$(CC) -c $(CPU_OPT) -o $@ $< makerule etags: $(SOURCES) ; etags $(SOURCES) makerule tags: $(SOURCES) ; ctags $(SOURCES) makerule documentation: $(SOURCES) ; doxygen LinuxBIOSDoc.config makerule clean : ; rm -f linuxbios.* *~ addaction clean rm -f linuxbios addaction clean rm -f ldoptions cpuflags ldscript.ld addaction clean rm -f a.out *.s *.l *.o addaction clean rm -f TAGS tags addaction clean rm -f docipl # do standard config files that the user need not specify # for now, this is just 'lib', but it may be more later. dir /src/lib dir /src/boot dir /src/rom