neatcc top-level makefile
[neatcc_make.git] / Makefile
blobde11de3b908dc70136db74d56b5b996f18a8541b
1 # Neatcc top-level Makefile
3 # output architecture: x64, x86, arm
4 OUT = x64
6 BASE = $(PWD)
8 all: help
10 help:
11 @echo "Neatcc top-level makefile"
12 @echo
13 @echo " init Initialise git repositories"
14 @echo " neat Compile the programs"
15 @echo " pull Update git repositories"
16 @echo " clean Remove the generated files"
17 @echo
19 init:
20 @test -d neatcc || git clone git://repo.or.cz/neatcc.git
21 @test -d neatld || git clone git://repo.or.cz/ld.git neatld
22 @test -d neatlibc || git clone git://repo.or.cz/neatlibc.git
23 @test -d neatas || git clone git://repo.or.cz/neatas.git
25 pull:
26 cd neatcc && git pull
27 cd neatld && git pull
28 cd neatlibc && git pull
29 cd neatas && git pull
30 git pull
32 neat:
33 # compilation the programs
34 @cd neatcc && $(MAKE) OUT=$(OUT)
35 @cd neatld && $(MAKE) OUT=$(OUT)
36 @cd neatlibc && $(MAKE) OUT=$(OUT) CC=../neatcc/ncc
37 @cd neatrun && $(MAKE) OUT=$(OUT) NCC=../_ncc NLD=../_nld NLC=../neatlibc
38 # bootstrapping
39 @cp neatcc/ncc _ncc
40 @cp neatld/nld _nld
41 @cp neatrun/neatcc _neatcc
42 @cd neatcc && $(MAKE) OUT=$(OUT) CC=../_neatcc clean all
43 @cd neatlibc && $(MAKE) OUT=$(OUT) CC=../neatcc/ncc clean all
44 @cd neatld && $(MAKE) OUT=$(OUT) CC=../_neatcc clean all
45 # setting up neatrun/neatcc
46 @cd neatrun && $(MAKE) OUT=$(OUT) CC=../_neatcc NCC=$(BASE)/neatcc/ncc \
47 NLD=$(BASE)/neatld/nld NLC=$(BASE)/neatlibc clean all
48 @rm _ncc _nld _neatcc
49 # compiling the rest
50 @cd neatas && $(MAKE) CC=../neatrun/neatcc OUT=$(OUT)
51 @cd neatdbg && $(MAKE) CC=../neatrun/neatcc OUT=$(OUT)
53 clean:
54 @cd neatcc && $(MAKE) clean
55 @cd neatlibc && $(MAKE) clean
56 @cd neatas && $(MAKE) clean
57 @cd neatld && $(MAKE) clean
58 @cd neatrun && $(MAKE) clean
59 @cd neatdbg && $(MAKE) clean