source: mainline/uspace/app/msim/Makefile@ 6c942e1

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

Better parallel building of MSIM

  • Property mode set to 100644
File size: 3.1 KB
Line 
1#
2# Copyright (c) 2012 Vojtech Horky
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
29USPACE_PREFIX = ../..
30BINARY = msim
31
32MSIM_VERSION = 1.3.8.1
33MSIM_DIST = msim-$(MSIM_VERSION)
34MSIM_TARBALL = $(MSIM_DIST).tar.bz2
35MSIM_MIRROR = http://d3s.mff.cuni.cz/~holub/sw/msim/
36
37MSIM_HELENOS_MAKEFILE = Makefile.msim.src
38MSIM_HELENOS_PLATFORM_FILES = helenos.c helenos_input.c
39MSIM_PATCHED_FILES = \
40 $(MSIM_DIST)/config.h \
41 $(MSIM_DIST)/src/$(MSIM_HELENOS_MAKEFILE) \
42 $(MSIM_DIST)/src/helenos.c \
43 $(MSIM_DIST)/src/helenos_input.c
44
45CP = /bin/cp -f
46
47all: $(BINARY)
48
49.PHONY: all clean unpack-tarball
50
51clean:
52 rm -rf msim Makefile.depend* *.map *.disasm $(MSIM_TARBALL) $(MSIM_DIST)
53
54$(BINARY): $(MSIM_DIST)/src/msim
55 $(CP) $< $@
56
57# Run make in MSIM src directory
58$(MSIM_DIST)/src/msim: $(MSIM_PATCHED_FILES) $(MSIM_DIST)/src/Makefile.sources Makefile
59 cd $(MSIM_DIST)/src; make -f $(MSIM_HELENOS_MAKEFILE) USPACE_PREFIX=../../$(USPACE_PREFIX)
60
61# Copy HelenOS specific files
62$(MSIM_DIST)/config.h: config.h.msim | unpack-tarball
63 $(CP) $< $@
64
65$(MSIM_DIST)/src/helenos.c: helenos.c | unpack-tarball
66 $(CP) $< $@
67
68$(MSIM_DIST)/src/helenos_input.c: helenos_input.c | unpack-tarball
69 $(CP) $< $@
70
71$(MSIM_DIST)/src/$(MSIM_HELENOS_MAKEFILE): $(MSIM_HELENOS_MAKEFILE) | unpack-tarball
72 $(CP) $< $@
73
74# Extract list of sources, remove POSIX/Linux specific
75$(MSIM_DIST)/src/Makefile.sources: | unpack-tarball
76 cd $(MSIM_DIST)/src; ( \
77 echo 'all__:'; \
78 echo -e '\t@echo SOURCES = $$(SOURCES)'; cat Makefile.in \
79 ) | make -f - | grep 'SOURCES' >Makefile.sources
80 sed \
81 -e 's:io/input.c:$(MSIM_HELENOS_PLATFORM_FILES):' \
82 -e 's:debug/gdb.c::' \
83 -e 's:arch/posix/stdin.c::' \
84 -i $(MSIM_DIST)/src/Makefile.sources
85
86# Download tarball
87$(MSIM_TARBALL):
88 wget "$(MSIM_MIRROR)$(MSIM_TARBALL)" -O $(MSIM_TARBALL)
89
90unpack-tarball: $(MSIM_TARBALL)
91 tar xjf $(MSIM_TARBALL)
Note: See TracBrowser for help on using the repository browser.