Skip to content

Commit 4570891

Browse files
author
Magnus Feuer
committed
Initial commit from 1.1.0b of internal svn
1 parent 830b2d4 commit 4570891

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+965480
-0
lines changed

Makefile

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
#
2+
# All rights reserved. Reproduction, modification, use or disclosure
3+
# to third parties without express authority is forbidden.
4+
# Copyright Magden LLC, California, USA, 2004, 2005, 2006, 2007.
5+
#
6+
7+
include Makefile.inc
8+
9+
#
10+
# Default app to checkout and build.
11+
# Override with make APP=xxx. Choose something from app
12+
#
13+
# Run the end result (in debug mode) as:
14+
#
15+
APP ?= jway/roll_demo
16+
17+
18+
#
19+
# Leave the following path definitions alone.
20+
# They just specify where in the local tree to checkout and build.
21+
#
22+
PLUGIN_PATH=./app/plugins
23+
PLUGIN_ABS_PATH=$(BUILD_ROOT)/$(PLUGIN_PATH)
24+
25+
APP_PATH=./app
26+
APP_ABS_PATH=$(BUILD_ROOT)/$(APP_PATH)
27+
28+
CORE_PATH=./core
29+
CORE_ABS_PATH=$(BUILD_ROOT)/$(CORE_PATH)
30+
31+
#
32+
# For now we will use native compilers.
33+
#
34+
CC=gcc
35+
CXX=g++
36+
37+
#
38+
# Target whose absence is used to trigger a checkout of:
39+
# m1/core
40+
# m1/tools/ddscomp (To compile bitmaps)
41+
# $(COMPILER)
42+
#
43+
CO_TRIGGER=./core/.svn/entries
44+
45+
.PHONY: kernel check_error update core
46+
47+
48+
49+
master_all: check_invocation core $(APP)
50+
51+
packfile: core plugins $(PAPP)
52+
53+
db: core plugins $(DAPP)
54+
55+
all_kernel: master_all kernel
56+
57+
check_invocation:
58+
ifeq ($(APP), nil)
59+
ifeq ($(PAPP), nil)
60+
$(error Usage: $(MAKE) APP="target_platform/skin1 target_platform/skin2 ...")
61+
endif
62+
endif
63+
64+
core: $(CO_TRIGGER)
65+
@echo
66+
@echo "--- Building core with external libs and tools."
67+
@(cd $(CORE_PATH);$(MAKE))
68+
69+
70+
plugins: $(CO_TRIGGER)
71+
@echo
72+
@echo "--- Building plugins."
73+
@(cd $(PLUGIN_PATH);$(MAKE))
74+
75+
kernel:
76+
@echo
77+
@echo "--- Building kernel."
78+
(cd kernel; $(MAKE) all install)
79+
@echo
80+
@echo "--- Building busybox"
81+
(cd busybox; $(MAKE))
82+
@echo
83+
@echo "--- Building udev"
84+
(cd udev; $(MAKE))
85+
86+
update:
87+
@echo
88+
@echo "--- Updating core."
89+
(cd m1; svn update)
90+
91+
m1e_packfile:
92+
(cd $(CORE_PATH); make packfile)
93+
94+
os_packfile:
95+
$(SHELL) create_os_packfile.sh
96+
97+
packfile: $(PAPP)
98+
99+
m1e_db:
100+
(cd $(CORE_PATH); make dpf)
101+
102+
db: $(DAPP)
103+
104+
$(PAPP): $(patsubst %,$(APP_ABS_ROOT)/%, $(PAPP))
105+
@echo
106+
@echo "--- Building skin packfile $(@)"
107+
@-rm -rf ptmp
108+
@-mkdir -p $(BUILD_ROOT)/ptmp > /dev/null 2>&1
109+
(cd $(abspath $(APP_ABS_ROOT))/$(@)/; $(MAKE) TARGET_DIR=$(BUILD_ROOT)/ptmp)
110+
(cd $(abspath $(APP_ABS_ROOT))/$(@)/; $(MAKE) pfile TARGET_DIR=$(BUILD_ROOT)/ptmp)
111+
112+
113+
$(DAPP): $(patsubst %,$(APP_ABS_ROOT)/%, $(DAPP))
114+
@echo
115+
@echo "--- Building DB packfile $(@)"
116+
@-rm -rf ptmp
117+
@-mkdir -p $(BUILD_ROOT)/ptmp > /dev/null 2>&1
118+
(cd $(abspath $(APP_ABS_ROOT))/$(@)/; $(MAKE) TARGET_DIR=$(BUILD_ROOT)/ptmp)
119+
(cd $(abspath $(APP_ABS_ROOT))/$(@)/; $(MAKE) dfile TARGET_DIR=$(BUILD_ROOT)/ptmp)
120+
121+
122+
123+
$(CO_TRIGGER):
124+
@echo
125+
@echo "--- Checking out m1 core."
126+
svn co -q $(SVN_SERVER)/m1/core/$(CORE_VERSION) core
127+
svn co -q $(SVN_SERVER)/m1/app/$(APP_VERSION) app
128+
129+
include Makefile.rules

Makefile.inc

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
#
2+
# All rights reserved. Reproduction, modification, use or disclosure
3+
# to third parties without express authority is forbidden.
4+
# Copyright Magden LLC, California, USA, 2004, 2005, 2006, 2007.
5+
#
6+
7+
#
8+
# Master include file used by app under m1/app/[platform]/[app]/[version]
9+
# Also used by the Makefile in this root directory.
10+
#
11+
12+
SHELL=/bin/bash
13+
export SHELL
14+
15+
BUILD_ROOT ?= $(PWD)
16+
export BUILD_ROOT
17+
18+
#
19+
# SVN server
20+
#
21+
SVN_SERVER ?= file:///home/m1/svn/magden
22+
export SVN_SERVER
23+
24+
#
25+
# Versions for different components (app etc)
26+
#
27+
include $(BUILD_ROOT)/Version.inc
28+
29+
export CORE_VERSION
30+
export APP_VERSION
31+
32+
M1_TARGET_ARCH ?= jway
33+
export M1_TARGET_ARCH
34+
35+
#
36+
# Target framebuffer descriptor
37+
# rgb, bgr, argb, bgra etc.
38+
# Will be passed on to ~/m1/app/src/[source_packet]/[version]/build_dds.sh
39+
#
40+
TARGET_FRAMEBUFFER ?= bgra
41+
export TARGET_FRAMEBUFFER
42+
43+
#
44+
# M1 core prefix
45+
#
46+
M1_CORE_ROOT=core
47+
export M1_CORE_ROOT
48+
#
49+
# M1 core absolute path
50+
#
51+
M1_CORE_ABS_ROOT=$(BUILD_ROOT)/$(M1_CORE_ROOT)
52+
export M1_CORE_ABS_ROOT
53+
#
54+
# M1 core include
55+
#
56+
#M1_CORE_INCLUDE=$(M1_CORE_ABS_ROOT)/$(CORE_VERSION)/include
57+
#export M1_CORE_INCLUDE
58+
59+
#
60+
# Epic include
61+
#
62+
#EPIC_INCLUDE=$(M1_CORE_ABS_ROOT)/$(CORE_VERSION)/epic/include
63+
#export EPIC_INCLUDE
64+
65+
#
66+
# Extern tool include
67+
#
68+
#EXTERN_INCLUDE=$(M1_CORE_ABS_ROOT)/$(CORE_VERSION)/extern/include
69+
#export EXTERN_INCLUDE
70+
71+
#
72+
# App prefix in SVN repository and in file system
73+
#
74+
APP_ROOT=app
75+
export APP_ROOT
76+
77+
#
78+
# Absolute path to app root dir in file system
79+
#
80+
APP_ABS_ROOT=$(BUILD_ROOT)/$(APP_ROOT)
81+
export APP_ABS_ROOT
82+
83+
#
84+
# Root prefix of all plugins both in SVN and file system
85+
#
86+
PLUGIN_ROOT=$(APP_ROOT)/plugins
87+
export PLUGIN_ROOT
88+
89+
#
90+
# Absolute path to plugin root in file system
91+
#
92+
PLUGIN_ABS_ROOT=$(BUILD_ROOT)/$(PLUGIN_ROOT)
93+
export PLUGIN_ABS_ROOT
94+
95+
#
96+
# Where do we want the result_m1, result_dds and result_launch directories
97+
# to be created. This local value will be overridden if this Makefile
98+
# is invoked by another make
99+
#
100+
TARGET_DIR?=$(PWD)/out
101+
export TARGET_DIR
102+
103+
104+
#
105+
# App prefix in SVN repository and in file system
106+
#
107+
FONT_ROOT=$(APP_ROOT)/src/fonts
108+
export FONT_ROOT
109+
110+
#
111+
# Absolute path to app root dir in file system
112+
#
113+
FONT_ABS_ROOT=$(APP_ABS_ROOT)/src/fonts
114+
export FONT_ABS_ROOT
115+
116+
#
117+
# BINDIR
118+
#
119+
BINDIR?=$(BUILD_ROOT)/bin
120+
export BINDIR
121+
122+
#
123+
# PACKDIR
124+
#
125+
PACKDIR?=$(BUILD_ROOT)/packfiles
126+
export PACKDIR
127+

Makefile.rules

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#
2+
# All rights reserved. Reproduction, modification, use or disclosure
3+
# to third parties without express authority is forbidden.
4+
# Copyright Magden LLC, California, USA, 2004, 2005, 2006, 2007.
5+
#
6+
7+
#
8+
# Master target for an app
9+
#
10+
11+
.PHONY: all
12+
all: $(PLUGINS) $(APP) $(DDS_SOURCE) install_result
13+
14+
15+
$(FONTS):
16+
(for target in $(FONTS); do ( cd $(FONTS_SOURCE); $(MAKE) $(FONT) TARGETDIR=$(PWD)/dds SIZES=$(SIZES); done )
17+
18+
$(APP): $(patsubst %,$(APP_ABS_ROOT)/%, $(APP))
19+
# Link in all files from the app to self's result_xxx directory
20+
@echo
21+
@echo "--- Building app $(@)"
22+
@(cd $(abspath $(APP_ABS_ROOT))/$(@); $(MAKE))
23+
# @(cd $(abspath $(APP_ABS_ROOT))/$(@); $(MAKE))
24+
25+
install_result:
26+
@echo
27+
@echo "--- Linking results for $$PWD/[m1,dds,launch] to $(abspath $(TARGET_DIR))"
28+
# Link in all files from self's m1/dds/launch directoru to the corresponding result directory.
29+
@-mkdir -p $(TARGET_DIR)/m1 $(TARGET_DIR)/dds $(TARGET_DIR)/launch > /dev/null 2>&1
30+
@(cd m1;shopt -s nullglob; for i in *.m1; do ln -snf $$PWD/$$i $(TARGET_DIR)/m1/$$i; done)
31+
@(cd dds; shopt -s nullglob; for i in *.efnt *.dds *.jpg *.png *.gif; do ln -snf $$PWD/$$i $(TARGET_DIR)/dds/$$i; done)
32+
@(cd launch;shopt -s nullglob; for i in *; do ln -snf $$PWD/$$i $(TARGET_DIR)/launch/$$i; done)
33+
34+
35+
36+
#
37+
# Link compiled DDS files from source directory to self.
38+
#
39+
$(DDS_SOURCE):
40+
cd $(patsubst %,$(APP_ABS_ROOT)/src/%,$(DDS_SOURCE)); make
41+
@echo
42+
@echo "--- Linking compiled files from DDS source $(@) to local dds dir"
43+
# remove stale links
44+
@-rm -f $(PWD)/dds/*.dds
45+
(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)
46+
47+
$(PF_TARGET):
48+
(cd $(TARGET_DIR); $(BINDIR)/fs2pf -o$(PACKDIR)/$(PF_TARGET) $(PF_NEED) -P/m1/ -L -i$(PF_PACKID) $(PF_POSTACTION) . )
49+
50+
51+
pfile: $(PF_TARGET)
52+
53+
dfile:
54+
(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) . )
55+
56+
$(PLUGINS): $(patsubst %,$(BUILD_ROOT)/lib/%.so, $(PLUGINS))
57+
-mkdir -p $(TARGET_DIR)/plugin > /dev/null 2>&1
58+
-rm -f $(TARGET_DIR)/plugin/$(patsubst $(BUILD_ROOT)/lib/%,%,$(@)).so
59+
ln -s $(BUILD_ROOT)/lib/$(@).so $(TARGET_DIR)/plugin
60+
61+
# Build rule for all plugins listed in PLUGINS
62+
$(patsubst %,$(BUILD_ROOT)/lib/%.so, $(PLUGINS)): $(patsubst %,$(PLUGIN_ABS_ROOT)/%,$(PLUGINS))
63+
@echo
64+
@echo "--- Linking $(abspath $(@)) to $(TARGET_DIR)/plugin"
65+
(cd $(PLUGIN_ABS_ROOT)/$(patsubst $(BUILD_ROOT)/lib/%.so,%,$(@)); $(MAKE))

0 commit comments

Comments
 (0)