]> rtime.felk.cvut.cz Git - sysless.git/blob - arch/h8300/generic/libs/boot/Makefile.omk
Only boot_fn library is needed in libs/boot.
[sysless.git] / arch / h8300 / generic / libs / boot / Makefile.omk
1 # -*- makefile -*-
2
3 lib_LIBRARIES=boot_fn
4 boot_fn_SOURCES = boot_fn.o
5
6
7 #bin_PROGRAMS = boot
8 boot_SOURCES = boot.c boot_fn.o
9
10 #link_VARIANTS = ram flash
11
12
13 INCLUDES = -g
14 lib_obj_SOURCES = crt0.S boot_fn.o
15
16 include_HEADERS = boot_fn.h
17
18 default_CONFIG = CONFIG_PIC_BOOT_FN=y
19
20 ifeq ($(CONFIG_PIC_BOOT_FN),y)
21 # The following is for non-standard compilation of boot_fn
22 define local_EVALUATE
23 $(call COMPILE_c_o_template,$(SOURCES_DIR)/boot_fn.c,boot_fn.s1,-fpic -S)
24 $(call COMPILE_S_o_template,boot_fn.s,boot_fn.o,-fpic -c)
25 endef
26
27 # This rule replaces jsr instructions by bsr ones which are relative
28 # calls.
29 boot_fn.s : boot_fn.s1
30         @$(QUIET_CMD_ECHO) "  SED     $@"
31         $(Q) sed 's/jsr[^0-9_A-Za-z]*@_\([0-9_A-Za-z]*\)\([^0-9_A-Za-z]*\)/bsr _\1:16\2/g' <$< >$@
32
33 clean-custom:
34         @rm boot_fn.s1 boot_fn.s
35 else
36 USER_SOURCES += boot_fn.c
37 endif # CONFIG_PIC_BOOT_FN