-
-
Notifications
You must be signed in to change notification settings - Fork 226
/
GNUmakefile
42 lines (35 loc) · 900 Bytes
/
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
# Directories
SRCDIR= ${CURDIR}
ALLDIRS!= find ${SRCDIR} -type d -not -path "./.git*"
# Packages
ROOTPKG= $(subst ${GOPATH}/src/,,${SRCDIR})
PACKAGES= sdl img mix ttf gfx
# Some cleanups
CLEANUP= *.cache *.core *~ *.orig
GO?= go
all: clean packages
clean:
@echo "Cleaning up..."
@for dir in ${ALLDIRS}; do \
cd $$dir && rm -f ${CLEANUP} && cd ${SRCDIR}; \
done
packages:
@for pkg in ${PACKAGES}; do \
echo "Building package ${ROOTPKG}/$$pkg..."; \
${GO} build ${ROOTPKG}/$$pkg; \
done
test:
@for pkg in ${PACKAGES}; do \
echo "Testing ${ROOTPKG}/$$pkg..."; \
${GO} test -v ${ROOTPKG}/$$pkg; \
done
coverage:
@for pkg in ${PACKAGES}; do \
echo "Coverage for ${ROOTPKG}/$$pkg..."; \
${GO} test -cover ${ROOTPKG}/$$pkg; \
done
bench:
@for pkg in ${PACKAGES}; do \
echo "Benchmarking ${ROOTPKG}/$$pkg..."; \
${GO} test -bench=. -cpu 1,2,3,4 ${ROOTPKG}/$$pkg; \
done