- Support for remember our compile time environment - Simple and always correct version of compute_ip_checksum - Improve message strings in crt0.base - Initial support for > 2G ram. - Sizeram now returns a list of valid ranges of ram - pci resource allocation now starts at 0xC0000000 - Update sizeram for every northbridge - Misc cleanups.
80 lines
3.7 KiB
Text
80 lines
3.7 KiB
Text
## This is Architecture independant part of the makefile
|
|
|
|
option LINUXBIOS_VERSION=1.0.0
|
|
|
|
option CROSS_COMPILE=
|
|
|
|
makedefine CC:=$(CROSS_COMPILE)gcc
|
|
makedefine CPP:= $(CROSS_COMPILE)gcc -x assembler-with-cpp -DASSEMBLY -E
|
|
makedefine OBJCOPY:=$(CROSS_COMPILE)objcopy
|
|
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
|
|
|
|
makedefine HOSTCC:=gcc
|
|
makedefine HOSTCFLAGS:= -Os -Wall
|
|
|
|
option LINUXBIOS_BUILD = $(shell date)
|
|
option LINUXBIOS_COMPILE_TIME = $(shell date +%T)
|
|
option LINUXBIOS_COMPILE_BY = $(shell whoami)
|
|
option LINUXBIOS_COMPILE_HOST = $(shell hostname)
|
|
option LINUXBIOS_COMPILE_DOMAIN = $(shell dnsdomainname)
|
|
option LINUXBIOS_COMPILER = $(shell $(CC) $(CFLAGS) -v 2>&1 | tail -1)
|
|
option LINUXBIOS_LINKER = $(shell $(CC) -Wl,-v 2>&1 | grep version | tail -1)
|
|
option LINUXBIOS_ASSEMBLER = $(shell touch dummy.s ; $(CC) -c -Wa,-v dummy.s 2>&1; rm -f dummy.s dummy.o )
|
|
|
|
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 $< $@
|
|
|
|
# Force crt0.s (which has build time version code in it to rebuild every time)
|
|
makedefine .PHONY : crt0.s
|
|
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 build_opt_tbl: $(TOP)/util/options/build_opt_tbl.c ; $(HOSTCC) $(HOSTCFLAGS) $< -o $@
|
|
|
|
makerule /$(TARGET_DIR)/option_table.c : build_opt_tbl $(MAINBOARD)/cmos.conf ; ./build_opt_tbl -b --config $(MAINBOARD)/cmos.conf
|
|
|
|
object /$(TARGET_DIR)/option_table.o HAVE_OPTION_TABLE
|
|
|
|
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
|
|
addaction clean rm -f build_opt_tbl option_table.c crt0.S
|
|
|
|
# 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
|
|
dir /src/pc80
|