-
Notifications
You must be signed in to change notification settings - Fork 3
/
GNUmakefile
50 lines (38 loc) · 1.12 KB
/
GNUmakefile
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
# Copyright (c) 2009, Gerard Lledo Vives <[email protected]>
# This program is open source. For license terms, see the LICENSE file.
AS=arm-linux-gnueabi-as
LD=arm-linux-gnueabi-ld
BIN=uforth
SRCS=$(filter-out init_sym.s, $(wildcard *.s ops/*.s)) init_sym.s
SRCS_OPS=$(wildcard ops/*.s)
OBJS=$(patsubst %.s,%.o,$(SRCS))
INCLUDES=$(wildcard *.asi)
TESTS=$(wildcard t/TC-*)
CTAGS=$(shell which ctags)
BUILD=clean-ws $(BIN) check check-license
ifdef CTAGS
BUILD+=tags
endif
all: $(BUILD)
init_sym.s: gen_symboltable.pl $(SRCS_OPS) compile.s
./gen_symboltable.pl > $@
$(BIN): $(OBJS) $(INCLUDES)
$(LD) $(OBJS) -o uforth
clean-ws:
@for FILE in `git-ls-files`; do \
sed -i "s/[ \t]*$$//" $${FILE} ; \
done ;
clean:
rm -f $(BIN) $(OBJS) init_sym.s tags
check-license:
@for FILE in `git-ls-files | sed 's/\.gitignore//'` ; do \
grep -q Copyright $${FILE} || echo "W: $${FILE} misses copyright statement" ; \
done ;
check: $(BIN) $(TESTS)
@for TC in $(TESTS); do \
echo " === Running tests:" `basename $${TC}` " === " ; \
./t/run-tests.pl $${TC} ; \
done ;
tags:
$(CTAGS) -R .
.PHONY: clean clean-ws check check-license