-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·61 lines (45 loc) · 1.22 KB
/
Copy pathMakefile
File metadata and controls
executable file
·61 lines (45 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#
# Top-level Makefile for ccc compiler
#
# Orchestrates builds across subdirectories
#
CC = gcc
# Installation destination - propagated to all submakes
DEST = $(realpath $(CURDIR)/root)
# Compiler implementation subdirectory
# COMPILER = ritchie
# COMPILER = hitech
COMPILER = ccc
# Subdirectories to build
DIRS = $(COMPILER) tools libsrc
SUBMAKE = $(MAKE) CC=$(CC) DEST=$(DEST)
all:
@for d in $(DIRS); do $(SUBMAKE) -C $$d all; done
install:
@mkdir -p $(DEST)/bin $(DEST)/lib
@for d in $(DIRS); do $(SUBMAKE) -C $$d install; done
clean:
@for d in $(DIRS); do $(SUBMAKE) -C $$d clean; done
rm -f *.ast *.s *.pp *.i *.x
rm -rf stage1
clobber:
@for d in $(DIRS); do $(SUBMAKE) -C $$d clobber; done
rm -f tags doc.pdf prev.size cur.size
stage1: install
@echo "Building stage1 with cross ccc"
@for d in $(DIRS); do $(MAKE) CC=ccc DEST=$(DEST) -C $$d stage1; done
@echo "Stage1 build complete"
test: install
$(SUBMAKE) -C tests test
tests: install
$(SUBMAKE) -C tests tests
valgrind: install
$(SUBMAKE) -C tests valgrind
tags:
ctags ccc/cpp/*.c ccc/pass1/*.c ccc/pass2/*.c tools/*.c
sizecheck:
@true
.PHONY: all install clean clobber stage1 test tests valgrind tags sizecheck
#
# vim: tabstop=4 shiftwidth=4 noexpandtab:
#