Fix cross compilation (e.g. on Darwin). Following changes to make.tmpl,
[AROS.git] / arch / all-pc / bootstrap / mmakefile.src
blob425c444249d0b94db344a3a867d095257df5ab40
1 # $Id$
3 include $(SRCDIR)/config/aros.cfg
5 #MM- boot-pc-i386: kernel-bootstrap-pc-gz
7 EXEDIR       := $(AROS_BOOT)/pc
8 EXENAME      := bootstrap
9 FILES        := bootstrap memory_io multiboot1 multiboot2 support vesa_setup
11 ifeq ($(CPU),x86_64)
12     ARCH_DEFS := -DMULTIBOOT_64BIT
13     ARCH_LIBS := -L$(GENDIR)/lib32 -nostdlib
14 else
15     ARCH_LIBS := -L$(AROSDIR)/Development/lib -L$(GENDIR)/lib
16 endif
18 USER_CFLAGS  := -Wl,--oformat,elf_i386 -m32 -isystem $(SRCDIR)/arch/all-native/bootconsole/include -isystem $(SRCDIR)/bootstrap/include \
19                 $(ARCH_DEFS) -DBOOTLOADER_$(AROS_TARGET_BOOTLOADER)
20 USER_LDFLAGS := -m32 -Wl,-N,-e,kernel_bootstrap -Wl,-Map,$(GENDIR)/boot/bootstrap-pc.map \
21                 -Wl,-T,$(SRCDIR)/$(CURDIR)/ldscript.lds -static-libgcc $(ARCH_LIBS)
22 USER_OBJS    := $(OBJDIR)/vesa.bin.o
24 CFLAGS       := $(filter-out -mcmodel=large,$(CFLAGS)) $(USER_CFLAGS)
26 BD_LINK := $(KERNEL_CC) $(SYSROOT_FLAG) $(KERNEL_LDFLAGS)
28 %build_prog mmake=kernel-bootstrap-pc progname=$(EXENAME) \
29         files=$(FILES) targetdir=$(EXEDIR) \
30         uselibs="bootstrap bootconsole stdc.static" usestartup=no lto=no
32 %rule_link_binary file=$(OBJDIR)/vesa.bin.o name=vesa files=vesa \
33         start=0x1000 ldflags="-m elf_i386"
35 %compress_file mmake=kernel-bootstrap-pc file=$(EXEDIR)/$(EXENAME)
37 # Add $(GENDIR)/boot to file's dependencies
38 $(EXEDIR)/$(EXENAME) : $(GENDIR)/boot
40 GLOB_MKDIRS += $(GENDIR)/boot
42 %common