Skip to content

Commit

Permalink
[grifo] add a grifo-simulate target
Browse files Browse the repository at this point in the history
This overwrites an installed image with host executables
and starts the simulated 'init.app'

Signed-off-by: Christopher Hall <hsw@openmoko.com>
  • Loading branch information
hxw committed Oct 14, 2010
1 parent 994b529 commit f6f200f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
10 changes: 8 additions & 2 deletions Makefile
Expand Up @@ -139,7 +139,7 @@ ALL_TARGETS += ${1}
ifeq (INSTALL,${4})
.PHONY: ${1}-install
${1}-install: ${1} validate-destdir
${MAKE} -C "${2}" DESTDIR="$${DESTDIR_PATH}" install
${MAKE} -C "${2}" DESTDIR="$${DESTDIR_PATH}" install ${5}

INSTALL_TARGETS += ${1}-install
endif
Expand Down Expand Up @@ -782,7 +782,12 @@ $(call STD_RULE, flash, ${SAMO_LIB}/flash, gcc mini-libc fatfs drivers, INSTALL)
# Grifo small kernel
# ==================

$(call STD_RULE, grifo, ${SAMO_LIB}/grifo, gcc mini-libc fatfs, INSTALL)
$(call STD_RULE, grifo, ${SAMO_LIB}/grifo, gcc mini-libc fatfs, INSTALL, INSTALL_GRIFO_SIMULATION="${INSTALL_GRIFO_SIMULATION}")

.PHONY: grifo-simulate
grifo-simulate: validate-destdir
make INSTALL_GRIFO_SIMULATION=YES DESTDIR="${DESTDIR}" grifo-install
cd "${DESTDIR}" && ./init.app


# Master boot record
Expand Down Expand Up @@ -923,6 +928,7 @@ help:
@echo ' fonts-install - install font files in DESTDIR'
@echo ' grifo - build the Grifo kernel and examples'
@echo ' grifo-install - install the Grifo kernel and examples'
@echo ' grifo-simulate - install the simulated Grifo examples - these run on host machine'
@echo ' gcc - compile gcc toolchain'
@echo ' flash-mbr - flash bootloader to the E07 board'
@echo ' qt4-simulator - compile the Qt4 simulator'
Expand Down
6 changes: 5 additions & 1 deletion samo-lib/grifo/Makefile
Expand Up @@ -41,6 +41,8 @@ include ${MK_DIR}/definitions.mk
# ---END_UPDATE_MAKEFILE: End of auto included code


INSTALL_GRIFO_SIMULATION ?= NO

$(call REQUIRED_BINARY, guile, guile-1.8)

INCLUDES += -Isrc
Expand Down Expand Up @@ -149,9 +151,11 @@ stamp-include:
.PHONY: install
install: all
@if [ ! -d "${DESTDIR}" ] ; then echo DESTDIR: "'"${DESTDIR}"'" is not a directory ; exit 1; fi
ifneq (YES,$(strip ${INSTALL_GRIFO_SIMULATION}))
${COPY} grifo.elf "${DESTDIR}"/kernel.elf
endif
${COPY} init.ini "${DESTDIR}"/
${MAKE} -C examples install
${MAKE} -C examples install INSTALL_GRIFO_SIMULATION="${INSTALL_GRIFO_SIMULATION}"

.PHONY: clean
clean:
Expand Down
6 changes: 5 additions & 1 deletion samo-lib/grifo/examples/Makefile
Expand Up @@ -38,6 +38,7 @@ MK_DIR := ${ROOT_DIR}/samo-lib/Mk
include ${MK_DIR}/definitions.mk
# ---END_UPDATE_MAKEFILE: End of auto included code

INSTALL_GRIFO_SIMULATION ?= NO

DIRS += events
DIRS += files
Expand All @@ -50,7 +51,10 @@ DIRS += wiki


${MAKECMDGOALS} all:
@for d in ${DIRS}; do ${MAKE} -C "$${d}" ${MAKECMDGOALS} || exit 1; done
@for d in ${DIRS}; \
do \
${MAKE} -C "$${d}" ${MAKECMDGOALS} INSTALL_GRIFO_SIMULATION="${INSTALL_GRIFO_SIMULATION}" || exit 1; \
done


include ${MK_DIR}/rules.mk
11 changes: 9 additions & 2 deletions samo-lib/grifo/examples/application-post.mk
Expand Up @@ -19,6 +19,7 @@

# nomally want simulation
SIMULATE ?= YES
INSTALL_GRIFO_SIMULATION ?= NO

ifeq (,$(strip ${PROGRAM}))
# ensure "PROGRAM = prog-name" is set
Expand Down Expand Up @@ -72,7 +73,7 @@ SIMULATE_FILES += $(addprefix ../,${HEADERS})

SIMULATE_DIR = simulate

TARGETS += simulate-make
EXTRA_TARGETS += simulate-make
CLEAN_TARGETS += ${SIMULATE_DIR}

simulate:
Expand Down Expand Up @@ -109,12 +110,18 @@ endif

# no more assignments to TARGETS or CLEAN_TARGETS after this point
.PHONY: build-targets
build-targets: ${TARGETS}
build-targets: ${TARGETS} ${EXTRA_TARGETS}

.PHONY: install
install: all
@if [ ! -d "${DESTDIR}" ] ; then echo DESTDIR: "'"${DESTDIR}"'" is not a directory ; exit 1; fi
${COPY} ${TARGETS} "${DESTDIR}"/
ifeq (YES,$(strip ${INSTALL_GRIFO_SIMULATION}))
ifeq (YES,$(strip ${SIMULATE}))
${COPY} "simulate/${PROGRAM}" "${DESTDIR}/${PROGRAM}.app"
endif
endif


.PHONY: clean
clean:
Expand Down

0 comments on commit f6f200f

Please sign in to comment.