1 # ----------------------------------------------------------------------------
2 # Hyper Operating System V4 Advance
3 # makefile for sh2-sample
5 # Copyright (C) 1998-2006 by Project HOS
6 # http://sourceforge.jp/projects/hos/
7 # ----------------------------------------------------------------------------
14 CMD_CC ?= $(GCC_ARCH)gcc
15 CMD_ASM ?= $(GCC_ARCH)gcc
16 CMD_LINK ?= $(GCC_ARCH)gcc
17 CMD_OBJCNV ?= $(GCC_ARCH)objcopy
21 TOP_DIR = ../../../../..
22 KERNEL_DIR = $(TOP_DIR)/kernel
23 KERNEL_CFGRTR_DIR = $(TOP_DIR)/cfgrtr/build/gcc
24 KERNEL_MAKINC_DIR = $(KERNEL_DIR)/build/common/gmake
25 KERNEL_BUILD_DIR = $(KERNEL_DIR)/build/sh/sh2/gcc
26 HOSAPLFW_DIR = $(TOP_DIR)/aplfw
27 HOSAPLFW_INC_DIR = $(HOSAPLFW_DIR)
28 HOSAPLFW_BUILD_DIR = $(HOSAPLFW_DIR)/build/sh/sh2/gcc
29 OBJS_DIR = objs_$(TARGET)
38 include $(KERNEL_MAKINC_DIR)/common.inc
42 KERNEL_CFGRTR = $(KERNEL_CFGRTR_DIR)/h4acfg-sh2
46 HOSAPLFW_LIB = $(HOSAPLFW_BUILD_DIR)/hosaplfw.$(EXT_LIB)
51 # %jp{外部メモリ(モニタプログラム利用を想定)}
52 TARGET := $(TARGET)ext
53 LINK_SCRIPT = link_ext.x
56 LINK_SCRIPT = link_rom.x
62 TARGET := $(TARGET)dbg
63 HOSAPLFW_LIB = $(HOSAPLFW_BUILD_DIR)/hosaplfwdbg.$(EXT_LIB)
70 LNFLAGS = -m2 -nostartfiles -Wl,-Map,$(TARGET).map,-T$(LINK_SCRIPT)
74 TARGET_EXE = $(TARGET).$(EXT_EXE)
75 TARGET_MOT = $(TARGET).$(EXT_MOT)
79 include $(KERNEL_MAKINC_DIR)/gcc_d.inc
83 INC_DIRS += $(HOSAPLFW_INC_DIR)
95 CSRCS += ../kernel_cfg.c \
101 LIBS += $(HOSAPLFW_LIB)
105 # --------------------------------------
107 # --------------------------------------
110 all: make_libs makeexe_all $(TARGET_EXE) $(TARGET_MOT)
114 $(MAKE) -C $(HOSAPLFW_BUILD_DIR) -f gmake.mak
118 rm -f $(TARGET_EXE) $(TARGET_EXE) $(OBJS) ../kernel_cfg.c ../kernel_id.h
121 mostlyclean: clean kernel_clean
122 $(MAKE) -C $(HOSAPLFW_BUILD_DIR) -f gmake.mak clean
125 depend: makeexe_depend
127 .PHONY : mostlydepend
128 mostlydepend: depend kernel_depend
129 $(MAKE) -C $(HOSAPLFW_BUILD_DIR) -f gmake.mak depend
132 srccpy: makeexe_srccpy
133 $(MAKE) -C $(KERNEL_BUILD_DIR) -f gmake.mak srccpy
134 $(MAKE) -C $(HOSAPLFW_BUILD_DIR) -f gmake.mak srccpy
136 ../kernel_cfg.c ../kernel_id.h: ../system.cfg $(KERNEL_CFGRTR)
137 cpp -E ../system.cfg ../system.i
138 $(KERNEL_CFGRTR) ../system.i -c ../kernel_cfg.c -i ../kernel_id.h
140 $(KERNEL_CFGRTR) : kernel_make
144 include $(KERNEL_MAKINC_DIR)/makeexe.inc
148 include $(KERNEL_MAKINC_DIR)/gcc_r.inc
152 # --------------------------------------
154 # --------------------------------------
156 $(OBJS_DIR)/sample.$(EXT_OBJ): ../sample.c ../kernel_id.h