source: mainline/boot/Makefile@ ae8d7b0

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since ae8d7b0 was 94c05b89, checked in by Martin Decky <martin@…>, 8 years ago

use the .incbin directive instead of marshalling the data manually
(this is the fastest and also the most resource-conservative method)

  • Property mode set to 100644
File size: 6.0 KB
Line 
1#
2# Copyright (c) 2006 Martin Decky
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions
7# are met:
8#
9# - Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer.
11# - Redistributions in binary form must reproduce the above copyright
12# notice, this list of conditions and the following disclaimer in the
13# documentation and/or other materials provided with the distribution.
14# - The name of the author may not be used to endorse or promote products
15# derived from this software without specific prior written permission.
16#
17# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27#
28
29.PHONY: all build_dist clean_dist clean
30
31include Makefile.common
32
33all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(PREBUILD) build_dist
34 $(MAKE) -r -f $(BUILD) PRECHECK=$(PRECHECK)
35ifneq ($(POSTBUILD),)
36 $(MAKE) -r -f $(POSTBUILD) PRECHECK=$(PRECHECK)
37endif
38
39build_dist: clean_dist
40 for file in $(RD_SRVS) ; do \
41 cp "$$file" "$(DIST_PATH)/srv/" ; \
42 done
43 for file in $(RD_LIBS) ; do \
44 cp "$$file" "$(DIST_PATH)/lib/" ; \
45 done
46ifeq ($(CONFIG_DEVEL_FILES), y)
47 mkdir "$(DIST_PATH)/inc/c/"
48 cp -r -L "$(USPACE_PATH)/lib/c/include/." "$(DIST_PATH)/inc/c/"
49 cp -r -L "$(ROOT_PATH)/abi/include/." "$(DIST_PATH)/inc/c/"
50 cp -r -L "$(USPACE_PATH)/lib/c/arch/$(UARCH)/include/." "$(DIST_PATH)/inc/c/"
51 cat "$(USPACE_PATH)/lib/c/arch/$(UARCH)/_link.ld" | sed 's/^STARTUP(.*)$$//g' > "$(DIST_PATH)/inc/_link.ld"
52endif
53 for file in $(RD_APPS) ; do \
54 cp "$$file" "$(DIST_PATH)/app/" ; \
55 done
56 for file in $(RD_DATA) ; do \
57 cp "$$file" "$(DIST_PATH)/" ; \
58 done
59ifeq ($(CONFIG_PCUT_TESTS),y)
60 echo "echo Running all tests..." >"$(DIST_PATH)/test/run_all"
61 echo "<html><head><title>HelenOS test results</title></head><body>" >"$(DIST_PATH)/test/test.html"
62 echo "<h1>HelenOS test results</h1><ul>" >>"$(DIST_PATH)/test/test.html"
63 for file in $(RD_TESTS) ; do \
64 file2=`basename $$file`; \
65 cp "$$file" "$(DIST_PATH)/test/" ; \
66 echo "echo ' ->' $$file2" >>"$(DIST_PATH)/test/run_all"; \
67 echo "/test/$$file2 | to /test/$$file2.out" >>"$(DIST_PATH)/test/run_all"; \
68 echo "cat /test/$$file2.out" >>"$(DIST_PATH)/test/run_all"; \
69 echo "cp -f /test/$$file2.out /data/web/result-$$file2.txt" >>"$(DIST_PATH)/test/run_all"; \
70 echo "<li><a href=\"result-$$file2.txt\">$$file2</a></li>" >>"$(DIST_PATH)/test/test.html"; \
71 done
72 echo "cp -f /test/test.html /data/web/test.html" >>"$(DIST_PATH)/test/run_all"
73 echo "</ul></body></html>" >>"$(DIST_PATH)/test/test.html"
74endif
75
76ifeq ($(CONFIG_PCUT_SELF_TESTS),y)
77 echo "echo Running all PCUT self-tests..." >"$(DIST_PATH)/test/run_pcut"
78 echo "<html><head><title>Results of PCUT self-tests on HelenOS</title></head><body>" >"$(DIST_PATH)/test/pcut.html"
79 echo "<h1>Results of PCUT self-tests on HelenOS</h1><ul>" >>"$(DIST_PATH)/test/pcut.html"
80 for file in $(USPACE_PATH)/lib/pcut/test-libpcut-*; do \
81 file2=`basename $$file`; \
82 name=`echo "$$file2" | sed 's/test-libpcut-//'`; \
83 cp "$$file" "$(DIST_PATH)/test/" ; \
84 echo "echo ' ->' $$name" >>"$(DIST_PATH)/test/run_pcut"; \
85 echo "/test/$$file2 | to /test/$$file2.out" >>"$(DIST_PATH)/test/run_pcut"; \
86 echo "cat /test/$$file2.out" >>"$(DIST_PATH)/test/run_pcut"; \
87 echo "cp -f /test/$$file2.out /data/web/result-$$file2.txt" >>"$(DIST_PATH)/test/run_pcut"; \
88 echo "<li><a href=\"result-$$file2.txt\">$$name</a></li>" >>"$(DIST_PATH)/test/pcut.html"; \
89 done
90 echo "cp -f /test/pcut.html /data/web/pcut.html" >>"$(DIST_PATH)/test/run_pcut"
91 echo "</ul></body></html>" >>"$(DIST_PATH)/test/pcut.html"
92endif
93
94 for drv in $(RD_DRVS) ; do \
95 drv_dir="`dirname "$$drv"`" ; \
96 drv_name="`basename "$$drv"`" ; \
97 mkdir -p "$(DIST_PATH)/$(DRVS_PATH)/$$drv_name" ; \
98 cp "$(USPACE_PATH)/$(DRVS_PATH)/$$drv_dir/$$drv_name/$$drv_name" "$(DIST_PATH)/$(DRVS_PATH)/$$drv_name/" ; \
99 cp "$(USPACE_PATH)/$(DRVS_PATH)/$$drv_dir/$$drv_name/$$drv_name.ma" "$(DIST_PATH)/$(DRVS_PATH)/$$drv_name/" ; \
100 done
101 for file in $(RD_DRV_CFG) ; do \
102 file_dir="`dirname "$$file"`" ; \
103 file_name="`basename "$$file"`" ; \
104 cp "$(USPACE_PATH)/$(DRVS_PATH)/$$file_dir/$$file_name/"*".dev" "$(DIST_PATH)/$(DRVS_PATH)/$$file_name/" ; \
105 done
106 for file in $(RD_DRVS_FW) ; do \
107 file_dir="`dirname "$$file"`" ; \
108 file_name="`basename "$$file"`" ; \
109 cp "$(USPACE_PATH)/$(DRVS_PATH)/$$file_dir/$$file_name/$$file_name.fw" "$(DIST_PATH)/$(DRVS_PATH)/$$file_name/" ; \
110 done
111 if ls $(DIST_OVERLAY_PATH)/* >/dev/null; then \
112 cp -r -L $(DIST_OVERLAY_PATH)/* "$(DIST_PATH)"; \
113 fi
114
115clean: clean_dist
116 $(MAKE) -r -f $(BUILD) clean PRECHECK=$(PRECHECK)
117ifneq ($(POSTBUILD),)
118 $(MAKE) -r -f $(POSTBUILD) clean PRECHECK=$(PRECHECK)
119endif
120 rm -f $(POST_OUTPUT) $(BOOT_OUTPUT) $(DEPEND) $(DEPEND_PREV) arch/*/include/common.h
121 find generic/src/ arch/*/src/ genarch/src/ -name '*.o' -follow -exec rm \{\} \;
122
123clean_dist:
124 rm -f $(INITRD).img $(COMPS).s $(COMPS).h $(COMPS)_desc.c $(COMPONENTS_DEFLATE) $(COMPS).o $(COMPS)_desc.o $(COMPS).zip $(LINK)
125 find $(USPACE_PATH)/dist -mindepth 1 -maxdepth 1 -type f -exec rm \{\} \;
126 rm -f $(USPACE_PATH)/dist/srv/*
127 rm -rf $(USPACE_PATH)/dist/drv/*
128 rm -rf $(USPACE_PATH)/dist/lib/*
129 rm -rf $(USPACE_PATH)/dist/inc/*
130 rm -f $(USPACE_PATH)/dist/app/*
131 rm -f $(USPACE_PATH)/dist/test/*
132 rm -f $(USPACE_PATH)/dist/cfg/net/*
Note: See TracBrowser for help on using the repository browser.