1 # Mes --- Maxwell Equations of Software
2 # Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
4 # This file is part of Mes.
6 # Mes is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or (at
9 # your option) any later version.
11 # Mes is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with Mes. If not, see <http://www.gnu.org/licenses/>.
19 GUILE_FLAGS:=--no-auto-compile -L . -L module -C . -C module
24 ./configure --prefix=$(prefix)
26 PHONY_TARGETS:= all all-go build check clean clean-go default doc help install install-info man\
27 gcc mes src/mes mes-gcc mes-tcc
29 .PHONY: $(PHONY_TARGETS)
42 build-aux/build-cc32.sh
46 CC32=$(TCC) build-aux/build-cc32.sh
49 $(warning skipping mes-tcc: no tcc)
53 build-aux/build-mes.sh
59 build-aux/build-guile.sh
62 rm -f $(shell find . -name '*.go')
70 .config.make: ./configure
72 seed: all-go mes-gcc mes-tcc
74 cd $(TINYCC_SEED) && MES_PREFIX=$(PWD) ./refresh.sh
76 cd $(MES_SEED) && git reset --hard HEAD
77 MES=$(GUILE) GUILE=$(GUILE) SEED=1 build-aux/build-mes.sh
78 cd $(MES_SEED) && MES_PREFIX=$(PWD) ./refresh.sh
79 MES=$(GUILE) GUILE=$(GUILE) SEED=1 build-aux/build-mes.sh
80 cp lib/x86-mes/elf32-header.hex2\
82 lib/x86-mes/libc+tcc.S\
85 lib/x86-mes/libgetopt.S\
86 $(MESCC_TOOLS_SEED)/libs
87 cd $(MESCC_TOOLS_SEED) && MES_PREFIX=$(PWD) ./bootstrap.sh
89 doc/version.texi: doc/mes.texi GNUmakefile
90 (set `LANG= date -r $< +'%d %B %Y'`;\
91 echo "@set UPDATED $$1 $$2 $$3"; \
92 echo "@set UPDATED-MONTH $$2 $$3"; \
93 echo "@set EDITION $(VERSION)"; \
94 echo "@set VERSION $(VERSION)") > $@
100 $(warning skipping info: no makeinfo)
106 $(warning skipping man: no help2man)
111 doc/mes.info: doc/mes.texi doc/version.texi GNUmakefile
112 $(MAKEINFO) -o $@ -I doc $<
116 man: doc/mes.1 doc/mescc.1
121 MES_ARENA=10000000 ./pre-inst-env $(HELP2MAN) $< > $@
123 doc/mescc.1: src/mes scripts/mescc
124 MES_ARENA=10000000 ./pre-inst-env $(HELP2MAN) $< > $@
128 mes/index.html: doc/mes.texi
129 $(MAKEINFO) --html -o doc/mes $<
133 doc/mes.pdf: doc/mes.texi
134 $(MAKEINFO) --pdf -o doc/mes.pdf $<
137 Usage: make [OPTION]... [TARGET]...
140 all update everything
141 all-go update .go files
142 cc update src/mes.gcc-out
143 doc update documentation
144 mes-gcc update src/mes.mes-gcc-out
145 mes-tcc update src/mes.mes-tcc-out
148 clean run git clean -dfx
149 clean-go clean .go files
150 info update info documentation
151 install install in $(prefix)
152 install-info install info docs in $(prefix)/share/info
153 seed update mes-seed in $(MES_SEED)
159 include build-aux/export.make