source: mainline/boot/Makefile@ d848752

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since d848752 was 01579ad, checked in by Vojtech Horky <vojtechhorky@…>, 11 years ago

Start work on PCUT integration

PCUT is a simple library for (hopefully) easier unit testing.
See https://github.com/vhotspur/pcut for more details.

  • Property mode set to 100644
File size: 4.9 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 build_comps clean_dist clean
30
31include Makefile.common
32
33all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(PREBUILD)
34 $(MAKE) -f $(BUILD) PRECHECK=$(PRECHECK)
35ifneq ($(POSTBUILD),)
36 $(MAKE) -f $(POSTBUILD) PRECHECK=$(PRECHECK)
37endif
38
39build_comps: $(COMPONENTS) $(LINK).in
40 $(PACK) $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) arch/$(KARCH) $(COMPONENTS)
41
42$(INITRD).img: build_dist
43ifeq ($(RDFMT),tmpfs)
44 $(MKTMPFS) $(DIST_PATH) $@
45endif
46ifeq ($(RDFMT),fat)
47 $(MKFAT) 1048576 $(DIST_PATH) $@
48endif
49ifeq ($(RDFMT),ext4fs)
50 $(MKEXT4) 1048576 $(DIST_PATH) $@
51endif
52
53build_dist: clean_dist
54 for file in $(RD_SRVS) ; do \
55 cp "$$file" "$(DIST_PATH)/srv/" ; \
56 done
57 for file in $(RD_LIBS) ; do \
58 cp "$$file" "$(DIST_PATH)/lib/" ; \
59 done
60ifeq ($(CONFIG_DEVEL_FILES), y)
61 mkdir "$(DIST_PATH)/inc/c/"
62 cp -r -L "$(USPACE_PATH)/lib/c/include/." "$(DIST_PATH)/inc/c/"
63 cp -r -L "$(ROOT_PATH)/abi/include/." "$(DIST_PATH)/inc/c/"
64 cp -r -L "$(USPACE_PATH)/lib/c/arch/$(UARCH)/include/." "$(DIST_PATH)/inc/c/"
65 cat "$(USPACE_PATH)/lib/c/arch/$(UARCH)/_link.ld" | sed 's/^STARTUP(.*)$$//g' > "$(DIST_PATH)/inc/_link.ld"
66endif
67 for file in $(RD_APPS) ; do \
68 cp "$$file" "$(DIST_PATH)/app/" ; \
69 done
70ifeq ($(CONFIG_PCUT_TESTS),y)
71 echo "echo Running all tests..." >"$(DIST_PATH)/test/run_all"
72 echo "<html><head><title>HelenOS test results</title></head><body>" >"$(DIST_PATH)/test/test.html"
73 echo "<h1>HelenOS test results</h1><ul>" >>"$(DIST_PATH)/test/test.html"
74 for file in $(RD_TESTS) ; do \
75 file2=`basename $$file`; \
76 cp "$$file" "$(DIST_PATH)/test/" ; \
77 echo "echo ' ->' $$file2" >>"$(DIST_PATH)/test/run_all"; \
78 echo "/test/$$file2 | to /test/$$file2.out" >>"$(DIST_PATH)/test/run_all"; \
79 echo "cat /test/$$file2.out" >>"$(DIST_PATH)/test/run_all"; \
80 echo "cp -f /test/$$file2.out /data/web/result-$$file2.txt" >>"$(DIST_PATH)/test/run_all"; \
81 echo "<li><a href=\"result-$$file2.txt\">$$file2</a></li>" >>"$(DIST_PATH)/test/test.html"; \
82 done
83 echo "cp -f /test/test.html /data/web/test.html" >>"$(DIST_PATH)/test/run_all"
84 echo "</ul></body></html>" >>"$(DIST_PATH)/test/test.html"
85endif
86
87 for drv in $(RD_DRVS) ; do \
88 drv_dir="`dirname "$$drv"`" ; \
89 drv_name="`basename "$$drv"`" ; \
90 mkdir -p "$(DIST_PATH)/$(DRVS_PATH)/$$drv_name" ; \
91 cp "$(USPACE_PATH)/$(DRVS_PATH)/$$drv_dir/$$drv_name/$$drv_name" "$(DIST_PATH)/$(DRVS_PATH)/$$drv_name/" ; \
92 cp "$(USPACE_PATH)/$(DRVS_PATH)/$$drv_dir/$$drv_name/$$drv_name.ma" "$(DIST_PATH)/$(DRVS_PATH)/$$drv_name/" ; \
93 done
94 for file in $(RD_DRV_CFG) ; do \
95 file_dir="`dirname "$$file"`" ; \
96 file_name="`basename "$$file"`" ; \
97 cp "$(USPACE_PATH)/$(DRVS_PATH)/$$file_dir/$$file_name/$$file_name.dev" "$(DIST_PATH)/$(DRVS_PATH)/$$file_name/" ; \
98 done
99 if ls $(DIST_OVERLAY_PATH)/* >/dev/null; then \
100 cp -r -L $(DIST_OVERLAY_PATH)/* "$(DIST_PATH)"; \
101 fi
102
103clean: clean_dist
104 $(MAKE) -f $(BUILD) clean PRECHECK=$(PRECHECK)
105ifneq ($(POSTBUILD),)
106 $(MAKE) -f $(POSTBUILD) clean PRECHECK=$(PRECHECK)
107endif
108 rm -fr $(SANDBOX)
109 rm -f $(POST_OUTPUT) $(BOOT_OUTPUT) $(DEPEND) $(DEPEND_PREV) arch/*/include/common.h
110 find generic/src/ arch/*/src/ genarch/src/ -name '*.o' -follow -exec rm \{\} \;
111
112clean_dist:
113 rm -f $(INITRD).img $(COMPS_H) $(COMPS_C) $(LINK) $(LINK).comp *.co
114 rm -f $(USPACE_PATH)/dist/srv/*
115 rm -rf $(USPACE_PATH)/dist/drv/*
116 rm -rf $(USPACE_PATH)/dist/lib/*
117 rm -rf $(USPACE_PATH)/dist/inc/*
118 rm -f $(USPACE_PATH)/dist/app/*
119 rm -f $(USPACE_PATH)/dist/test/*
120 rm -f $(USPACE_PATH)/dist/cfg/net/*
Note: See TracBrowser for help on using the repository browser.