summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/motorola_powerpc/bootloader/Makefile.am
blob: 8e4395769981804779b9415954b6d6344045efc0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
## 
## $Id$
## 

AUTOMAKE_OPTIONS = foreign 1.4

VPATH = @srcdir@:@srcdir@/../../../shared:@srcdir@/../../shared/console:@srcdir@/../../shared/bootloader

C_FILES = misc.c pci.c zlib.c mm.c em86.c polled_io.c lib.c
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)

H_FILES = bootldr.h zlib.h pci.h

S_FILES = head.S exception.S em86real.S
S_O_FILES = $(S_FILES:%.S=$(ARCH)/%.o)

OBJS = $(S_O_FILES) $(C_O_FILES)

include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../../../../../../automake/lib.am

#
# (OPTIONAL) Add local stuff here using +=
#

AM_CPPFLAGS += -D__BOOT__ -DDEBUG
AM_CFLAGS += -msoft-float -mstrict-align -fno-builtin -Wall -mmultiple \
    -mstring -O2 -fomit-frame-pointer -mrelocatable -ffixed-r13 -mno-sdata \
    -D__BOOT__ -DDEBUG

ASFLAGS += -mrelocatable

IMAGES = rtems.gz

CLEANFILES += bootloader reloc.O
DISTCLEANFILES += $(IMAGES)

#
# CAUTION :
#
# As we use very specific compilation options in this directory
# we shall not use any other code. This includes the newlib libc.a
# as well as other code located in .o files in mcp750 directory.
#
# NEVER remove lib.c. You have been warned...
#
bootloader : $(OBJS) $(IMAGES) $(BINARY_LOADED) ppcboot.lds
	$(LD) -o bootloader $(OBJS) --just-symbols=$(BINARY_LOADED) \
	-b binary $(IMAGES) -T @srcdir@/../../shared/bootloader/ppcboot.lds \
	-Map bootloader.map

check_unresolved : $(OBJS)
	$(LD) -r -o reloc.O $(OBJS)
	$(NM) reloc.O |grep ' U '
	echo "Every symbol listed should be defined in @srcdir@/ppcboot.lds"

rtems: $(BINARY_LOADED)
	$(OBJCOPY)  $(BINARY_LOADED) rtems -O binary -R .comment -S 

rtems.gz: rtems
	gzip -vf9 rtems

all-local: $(ARCH) $(OBJS)

include $(top_srcdir)/../../../../../../automake/local.am