Skip to content

Commit

Permalink
Initial commit from 1.1.0b of internal svn
Browse files Browse the repository at this point in the history
  • Loading branch information
Magnus Feuer committed Feb 1, 2015
1 parent 830b2d4 commit 4570891
Show file tree
Hide file tree
Showing 104 changed files with 965,480 additions and 0 deletions.
129 changes: 129 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
#
# All rights reserved. Reproduction, modification, use or disclosure
# to third parties without express authority is forbidden.
# Copyright Magden LLC, California, USA, 2004, 2005, 2006, 2007.
#

include Makefile.inc

#
# Default app to checkout and build.
# Override with make APP=xxx. Choose something from app
#
# Run the end result (in debug mode) as:
#
APP ?= jway/roll_demo


#
# Leave the following path definitions alone.
# They just specify where in the local tree to checkout and build.
#
PLUGIN_PATH=./app/plugins
PLUGIN_ABS_PATH=$(BUILD_ROOT)/$(PLUGIN_PATH)

APP_PATH=./app
APP_ABS_PATH=$(BUILD_ROOT)/$(APP_PATH)

CORE_PATH=./core
CORE_ABS_PATH=$(BUILD_ROOT)/$(CORE_PATH)

#
# For now we will use native compilers.
#
CC=gcc
CXX=g++

#
# Target whose absence is used to trigger a checkout of:
# m1/core
# m1/tools/ddscomp (To compile bitmaps)
# $(COMPILER)
#
CO_TRIGGER=./core/.svn/entries

.PHONY: kernel check_error update core



master_all: check_invocation core $(APP)

packfile: core plugins $(PAPP)

db: core plugins $(DAPP)

all_kernel: master_all kernel

check_invocation:
ifeq ($(APP), nil)
ifeq ($(PAPP), nil)
$(error Usage: $(MAKE) APP="target_platform/skin1 target_platform/skin2 ...")
endif
endif

core: $(CO_TRIGGER)
@echo
@echo "--- Building core with external libs and tools."
@(cd $(CORE_PATH);$(MAKE))


plugins: $(CO_TRIGGER)
@echo
@echo "--- Building plugins."
@(cd $(PLUGIN_PATH);$(MAKE))

kernel:
@echo
@echo "--- Building kernel."
(cd kernel; $(MAKE) all install)
@echo
@echo "--- Building busybox"
(cd busybox; $(MAKE))
@echo
@echo "--- Building udev"
(cd udev; $(MAKE))

update:
@echo
@echo "--- Updating core."
(cd m1; svn update)

m1e_packfile:
(cd $(CORE_PATH); make packfile)

os_packfile:
$(SHELL) create_os_packfile.sh

packfile: $(PAPP)

m1e_db:
(cd $(CORE_PATH); make dpf)

db: $(DAPP)

$(PAPP): $(patsubst %,$(APP_ABS_ROOT)/%, $(PAPP))
@echo
@echo "--- Building skin packfile $(@)"
@-rm -rf ptmp
@-mkdir -p $(BUILD_ROOT)/ptmp > /dev/null 2>&1
(cd $(abspath $(APP_ABS_ROOT))/$(@)/; $(MAKE) TARGET_DIR=$(BUILD_ROOT)/ptmp)
(cd $(abspath $(APP_ABS_ROOT))/$(@)/; $(MAKE) pfile TARGET_DIR=$(BUILD_ROOT)/ptmp)


$(DAPP): $(patsubst %,$(APP_ABS_ROOT)/%, $(DAPP))
@echo
@echo "--- Building DB packfile $(@)"
@-rm -rf ptmp
@-mkdir -p $(BUILD_ROOT)/ptmp > /dev/null 2>&1
(cd $(abspath $(APP_ABS_ROOT))/$(@)/; $(MAKE) TARGET_DIR=$(BUILD_ROOT)/ptmp)
(cd $(abspath $(APP_ABS_ROOT))/$(@)/; $(MAKE) dfile TARGET_DIR=$(BUILD_ROOT)/ptmp)



$(CO_TRIGGER):
@echo
@echo "--- Checking out m1 core."
svn co -q $(SVN_SERVER)/m1/core/$(CORE_VERSION) core
svn co -q $(SVN_SERVER)/m1/app/$(APP_VERSION) app

include Makefile.rules
127 changes: 127 additions & 0 deletions Makefile.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
#
# All rights reserved. Reproduction, modification, use or disclosure
# to third parties without express authority is forbidden.
# Copyright Magden LLC, California, USA, 2004, 2005, 2006, 2007.
#

#
# Master include file used by app under m1/app/[platform]/[app]/[version]
# Also used by the Makefile in this root directory.
#

SHELL=/bin/bash
export SHELL

BUILD_ROOT ?= $(PWD)
export BUILD_ROOT

#
# SVN server
#
SVN_SERVER ?= file:///home/m1/svn/magden
export SVN_SERVER

#
# Versions for different components (app etc)
#
include $(BUILD_ROOT)/Version.inc

export CORE_VERSION
export APP_VERSION

M1_TARGET_ARCH ?= jway
export M1_TARGET_ARCH

#
# Target framebuffer descriptor
# rgb, bgr, argb, bgra etc.
# Will be passed on to ~/m1/app/src/[source_packet]/[version]/build_dds.sh
#
TARGET_FRAMEBUFFER ?= bgra
export TARGET_FRAMEBUFFER

#
# M1 core prefix
#
M1_CORE_ROOT=core
export M1_CORE_ROOT
#
# M1 core absolute path
#
M1_CORE_ABS_ROOT=$(BUILD_ROOT)/$(M1_CORE_ROOT)
export M1_CORE_ABS_ROOT
#
# M1 core include
#
#M1_CORE_INCLUDE=$(M1_CORE_ABS_ROOT)/$(CORE_VERSION)/include
#export M1_CORE_INCLUDE

#
# Epic include
#
#EPIC_INCLUDE=$(M1_CORE_ABS_ROOT)/$(CORE_VERSION)/epic/include
#export EPIC_INCLUDE

#
# Extern tool include
#
#EXTERN_INCLUDE=$(M1_CORE_ABS_ROOT)/$(CORE_VERSION)/extern/include
#export EXTERN_INCLUDE

#
# App prefix in SVN repository and in file system
#
APP_ROOT=app
export APP_ROOT

#
# Absolute path to app root dir in file system
#
APP_ABS_ROOT=$(BUILD_ROOT)/$(APP_ROOT)
export APP_ABS_ROOT

#
# Root prefix of all plugins both in SVN and file system
#
PLUGIN_ROOT=$(APP_ROOT)/plugins
export PLUGIN_ROOT

#
# Absolute path to plugin root in file system
#
PLUGIN_ABS_ROOT=$(BUILD_ROOT)/$(PLUGIN_ROOT)
export PLUGIN_ABS_ROOT

#
# Where do we want the result_m1, result_dds and result_launch directories
# to be created. This local value will be overridden if this Makefile
# is invoked by another make
#
TARGET_DIR?=$(PWD)/out
export TARGET_DIR


#
# App prefix in SVN repository and in file system
#
FONT_ROOT=$(APP_ROOT)/src/fonts
export FONT_ROOT

#
# Absolute path to app root dir in file system
#
FONT_ABS_ROOT=$(APP_ABS_ROOT)/src/fonts
export FONT_ABS_ROOT

#
# BINDIR
#
BINDIR?=$(BUILD_ROOT)/bin
export BINDIR

#
# PACKDIR
#
PACKDIR?=$(BUILD_ROOT)/packfiles
export PACKDIR

65 changes: 65 additions & 0 deletions Makefile.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#
# All rights reserved. Reproduction, modification, use or disclosure
# to third parties without express authority is forbidden.
# Copyright Magden LLC, California, USA, 2004, 2005, 2006, 2007.
#

#
# Master target for an app
#

.PHONY: all
all: $(PLUGINS) $(APP) $(DDS_SOURCE) install_result


$(FONTS):
(for target in $(FONTS); do ( cd $(FONTS_SOURCE); $(MAKE) $(FONT) TARGETDIR=$(PWD)/dds SIZES=$(SIZES); done )

$(APP): $(patsubst %,$(APP_ABS_ROOT)/%, $(APP))
# Link in all files from the app to self's result_xxx directory
@echo
@echo "--- Building app $(@)"
@(cd $(abspath $(APP_ABS_ROOT))/$(@); $(MAKE))
# @(cd $(abspath $(APP_ABS_ROOT))/$(@); $(MAKE))

install_result:
@echo
@echo "--- Linking results for $$PWD/[m1,dds,launch] to $(abspath $(TARGET_DIR))"
# Link in all files from self's m1/dds/launch directoru to the corresponding result directory.
@-mkdir -p $(TARGET_DIR)/m1 $(TARGET_DIR)/dds $(TARGET_DIR)/launch > /dev/null 2>&1
@(cd m1;shopt -s nullglob; for i in *.m1; do ln -snf $$PWD/$$i $(TARGET_DIR)/m1/$$i; done)
@(cd dds; shopt -s nullglob; for i in *.efnt *.dds *.jpg *.png *.gif; do ln -snf $$PWD/$$i $(TARGET_DIR)/dds/$$i; done)
@(cd launch;shopt -s nullglob; for i in *; do ln -snf $$PWD/$$i $(TARGET_DIR)/launch/$$i; done)



#
# Link compiled DDS files from source directory to self.
#
$(DDS_SOURCE):
cd $(patsubst %,$(APP_ABS_ROOT)/src/%,$(DDS_SOURCE)); make
@echo
@echo "--- Linking compiled files from DDS source $(@) to local dds dir"
# remove stale links
@-rm -f $(PWD)/dds/*.dds
(cd $(abspath $(APP_ABS_ROOT)/src/$(@)/$(TARGET_FRAMEBUFFER)_dds); shopt -s nullglob; for i in *.efnt *.dds *.jpg *.png *.gif; do ln -sfn $$PWD/$$i $(PWD)/dds/$$i; done)

$(PF_TARGET):
(cd $(TARGET_DIR); $(BINDIR)/fs2pf -o$(PACKDIR)/$(PF_TARGET) $(PF_NEED) -P/m1/ -L -i$(PF_PACKID) $(PF_POSTACTION) . )


pfile: $(PF_TARGET)

dfile:
(rev=`svn info | grep Revision | cut -d' ' -f 2`; cd $(TARGET_DIR); $(BINDIR)/fs2db -h$(DB_HOST) -u$(DB_USER) -p$(DB_PASSWORD) -d$(DB_DATABASE) -s$$rev $(PF_NEED) -r/m1/ -L -i$(PF_PACKID) $(PF_POSTACTION) . )

$(PLUGINS): $(patsubst %,$(BUILD_ROOT)/lib/%.so, $(PLUGINS))
-mkdir -p $(TARGET_DIR)/plugin > /dev/null 2>&1
-rm -f $(TARGET_DIR)/plugin/$(patsubst $(BUILD_ROOT)/lib/%,%,$(@)).so
ln -s $(BUILD_ROOT)/lib/$(@).so $(TARGET_DIR)/plugin

# Build rule for all plugins listed in PLUGINS
$(patsubst %,$(BUILD_ROOT)/lib/%.so, $(PLUGINS)): $(patsubst %,$(PLUGIN_ABS_ROOT)/%,$(PLUGINS))
@echo
@echo "--- Linking $(abspath $(@)) to $(TARGET_DIR)/plugin"
(cd $(PLUGIN_ABS_ROOT)/$(patsubst $(BUILD_ROOT)/lib/%.so,%,$(@)); $(MAKE))
Loading

0 comments on commit 4570891

Please sign in to comment.