-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
47 lines (38 loc) · 968 Bytes
/
Makefile
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
# Root Makefile for Quad Solver
VERSION = 1.0
PROGRAM_NAME = quad-solver
FILE_LIST = \
LICENSE \
Makefile \
readme.md \
documents \
src \
tests \
spikes \
stories
# Ensure that commands run as intended, even if file with same name exists.
.PHONY: build distribute test clean
# Default command if nothing is passed.
default: build
# Build and zip up project into tar file.
distribute:
make -C src clean
make -C tests clean
rm -rf $(PROGRAM_NAME)-$(VERSION)
mkdir -p $(PROGRAM_NAME)-$(VERSION)
cp -R $(FILE_LIST) $(PROGRAM_NAME)-$(VERSION)
tar cf - $(PROGRAM_NAME)-$(VERSION) | gzip -9c > $(PROGRAM_NAME)-$(VERSION).tar.gz
rm -rf $(PROGRAM_NAME)-$(VERSION)
# Build project in src directory.
build:
make -C src
@echo "Binary created at src/quad_solver"
# Run all program tests.
test:
make -C src
make -C tests
# Remove older builds and clear temp files.
clean:
make -C src clean
make -C tests clean
rm -rf $(PROGRAM_NAME)-$(VERSION).tar.gz