-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
170 lines (125 loc) · 4.59 KB
/
Makefile
File metadata and controls
170 lines (125 loc) · 4.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
### ==========================================================================
### $Id: Makefile 886 2009-04-21 13:00:15Z hoenicke $
### FILE: Makefile - make all parts of the bibo distribution
### bibo - another LEGO MindStorms RCX OS
### --------------------------------------------------------------------------
### (This is the top-level Makefile. All actions are performed from here)
# Project-related names (all lowercase by convention)
ORG = brickbot
PACKAGE = brickos
BRICK_ARCH = h8300-lego-coff
KERNEL ?= bibo
# Version of this release
VERSION_MAJOR = 1
VERSION_MINOR = 0
VERSION_PATCH = 0
VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)
VERSION_SERIES = v$(VERSION_MAJOR)
# ------------------------------------------------------------
# No user customization below here...
# ------------------------------------------------------------
#
# makefile to build the brickOS operating system and demo files
#
SUBDIRS=util lib include kconfig kernel rom xs
# The dependent targets for "all"
MAKE_ALL_TARGETS=host include kernel rom
# Excluded targets: docs (currently broken?)
# Only build the demo programs if program support is enabled
ifeq ($(shell grep --quiet '^\#define CONF_PROGRAM' include/config.h && echo 1),1)
SUBDIRS += demo
MAKE_ALL_TARGETS += demo
else
$(info NOTE: CONF_PROGRAM support for programs disabled; skipping building of demo programs)
endif
# Add docs to the subdirs list last
SUBDIRS += doc
all:: $(MAKE_ALL_TARGETS)
include Makefile.common
include $(SUBDIRS:%=%/Makefile.sub)
include Makefile.doxygen
include Makefile.utility
clean:: $(MAKE_ALL_TARGETS:%=%-clean)
realclean:: clean $(MAKE_ALL_TARGETS:%=%-realclean)
rm -f tags TAGS *.bak *~ *.bak
install:: $(MAKE_ALL_TARGETS:%=%-install)
uninstall:: $(MAKE_ALL_TARGETS:%=%-uninstall)
#
# Setup the relationships between "host" targets and "makefiles" targets
#
host:: makefiles
host-install:: makefiles-install
host-uninstall:: makefiles-uninstall
host-clean:: makefiles-clean
host-realclean:: makefiles-realclean
#
# install/unnistall makefiles
#
makefiles::
makefiles-install::
test -d $(DESTDIR)$(pkgtargetsysconfdir) || mkdir -p $(DESTDIR)$(pkgtargetsysconfdir)
install -m 644 Makefile.common Makefile.configure $(HOST_PROPERTIES_FILE) $(DESTDIR)$(pkgtargetsysconfdir)
sed -e '/Installation Variables/a \
ORG = $(ORG)\
PACKAGE = $(PACKAGE)\
BRICK_ARCH = $(BRICK_ARCH)'\
< Makefile.lxprog > $(DESTDIR)$(pkgtargetsysconfdir)/Makefile
chmod 644 $(DESTDIR)$(pkgtargetsysconfdir)/Makefile
test -d $(DESTDIR)$(bindir) || mkdir -p $(DESTDIR)$(bindir)
sed -e '/Installation Variables/a \
ORG=$(ORG)\
PACKAGE=$(PACKAGE)\
SYSCONF_PACKAGESUBDIR=$(SYSCONF_PACKAGESUBDIR)\
BRICK_ARCH=$(BRICK_ARCH)'\
< makelx.sh > $(DESTDIR)$(bindir)/makelx
chmod 755 $(DESTDIR)$(bindir)/makelx
makefiles-uninstall::
rm -f $(DESTDIR)$(pkgtargetsysconfdir)/Makefile
rm -f $(DESTDIR)$(pkgtargetsysconfdir)/Makefile.common
rm -f $(DESTDIR)$(pkgtargetsysconfdir)/Makefile.configure
rm -f $(DESTDIR)$(pkgtargetsysconfdir)/$(HOST_PROPERTIES_FILE)
rm -f $(DESTDIR)$(bindir)/makelx
makefiles-clean::
makefiles-realclean:: makefiles-clean
rm -f $(HOST_PROPERTIES_PATH)
# NOTE: --format=1 is not supported on Linux ([ce]tags in emacs2[01] packages)
# please set in your own environment
tag::
-ctags kernel/*.c include/*.h include/*/*.h
-etags kernel/*.c include/*.h include/*/*.h
.PHONY: all depend tag clean realclean html tag c++ html html-c html-c++ html-kern html-dist
# ------------------------------------------------------------
# Components of this release to be packaged
# ------------------------------------------------------------
#
DISTFILES += h8300-rcx.ld configure \
makelx.sh README CONTRIBUTORS LICENSE \
Makefile Makefile.common Makefile.lxprog
# locations for this package build effort
DISTDIR = $(PACKAGE)-$(VERSION)
# tools we use to make distribution image
TAR = tar
GZIP_ENV = --best
DISTDISTFILES = $(DISTFILES:%=$(DISTDIR)/%)
# make our distribution tarball
dist: distclean $(DISTDISTFILES)
GZIP=$(GZIP_ENV) $(TAR) chozf $(DISTDIR).tar.gz $(DISTDIR)
@echo "---------------------------------------------------------"
@echo " MD5 sum for $(PACKAGE) v$(VERSION)"
@md5sum $(DISTDIR).tar.gz
@echo "---------------------------------------------------------"
distclean:
rm -rf $(DISTDIR)
# build a copy of the source tree which can be zipped up and then deleted
$(DISTDISTFILES): $(DISTDIR)/%: %
@echo $@
@mkdir -p $(dir $@)
@cp -p $< $@
###
### generic rules
###
# cancel standard C source rule
%.o: %.c
# how to compile native C source
$(NATIVEOBJS): %.o: %.c
$(CC) -MMD $(CFLAGS) -c $< -o $@