build: Check for mes-seed, tinycc-seed.
[mes.git] / GNUmakefile
1 GUILE:=guile
2 GUILE_FLAGS:=--no-auto-compile -L . -L guile -C . -C guile
3
4 include .config.make
5
6 PHONY_TARGETS:= all all-go check clean clean-go default help install
7 .PHONY: $(PHONY_TARGETS)
8
9 default: all
10
11 all:
12         ./build.sh
13
14 cc:
15         build-aux/build-cc.sh
16
17 mlibc:
18         build-aux/build-mlibc.sh
19
20 mes:
21         build-aux/build-mes.sh
22
23 clean:
24         git clean -dfx
25
26 all-go:
27         build-aux/build-guile.sh
28
29 clean-go:
30         rm -f $(shell find . -name '*.go')
31
32 check:
33         ./check.sh
34
35
36 install:
37         ./install.sh
38
39 .config.make: ./configure
40
41 seed:
42         cd $(MES_SEED) && git reset --hard HEAD
43         MES=$(GUILE) GUILE=$(GUILE) SEED=1 build-aux/build-mes.sh
44         cd $(MES_SEED) && MES_PREFIX=$(PWD) ./refresh.sh
45         MES=$(GUILE) GUILE=$(GUILE) SEED=1 build-aux/build-mes.sh
46         build-aux/build-mlibc.sh
47         cd $(TINYCC_SEED) && MES_PREFIX=$(PWD) ./refresh.sh
48
49 define HELP_TOP
50 Usage: make [OPTION]... [TARGET]...
51
52 Targets:
53   all             update everything
54   all-go          update .go files
55   cc              update src/mes.gcc-out
56   mlibc           update src/mes.mlibc-out
57   mes             update src/mes
58   check           run unit tests
59   clean           run git clean -dfx
60   clean-go        clean .go files
61   install         install in $(PREFIX)
62   seed            update mes-seed in $(MES_SEED)
63 endef
64 export HELP_TOP
65 help:
66         @echo "$$HELP_TOP"
67
68 ifdef PREFIX
69 export PREFIX
70 endif
71
72 ifdef VERSION
73 export VERSION
74 endif
75
76 ifdef CC
77 export CC
78 endif
79
80 ifdef CC32
81 export CC32
82 endif
83
84 ifdef BLOOD_ELF
85 export BLOOD_ELF
86 endif
87
88 ifdef M1
89 export M1
90 endif
91
92 ifdef HEX2
93 export HEX2
94 endif
95
96 ifdef GUILE
97 export GUILE
98 endif
99
100 ifdef GUILE_TOOLS
101 export GUILE_TOOLS
102 endif
103
104 ifdef GUILE_LOAD_PATH
105 export GUILE_LOAD_PATH
106 endif
107
108 ifdef GUILE_LOAD_COMPILED_PATH
109 export GUILE_LOAD_COMPILED_PATH
110 endif
111
112 ifdef CFLAGS
113 export CFLAGS
114 endif
115
116 ifdef C32FLAGS
117 export C32FLAGS
118 endif
119
120 ifdef HEX2FLAGS
121 export HEX2FLAGS
122 endif
123
124 ifdef M1FLAGS
125 export M1FLAGS
126 endif
127
128 ifdef MESCCFLAGS
129 export MESCCFLAGS
130 endif
131
132 ifdef MES_SEED
133 export MES_SEED
134 endif
135
136 ifdef TINYCC_SEED
137 export TINYCC_SEED
138 endif