This repository has been archived by the owner on Jun 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (45 loc) · 1.51 KB
/
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Root of the build sub-system of the tool and extra-resources directory.
# These *must match* the actual folders in the tree.
#
dir_building := building
dir_etc := etc
# Name of the folder for the results of compilation, and for the release
# These are *configuration choices* of this Makefile
#
dir_binaries := 0build
dir_release := release
# Actual path where the building-output will be found
#
dir_build_out := $(dir_building)/$(dir_binaries)
# RSYNC script (add '--verbose --dry-run' for debugging)
#
cmd_sync := rsync --perms --times --recursive --exclude='*gen' --exclude='.*'
#
# TARGETS
#
all : dobuild
# Copy the output of the building process (i.e. binaries) into the release subdirectory
#
release : dobuild copy-sample | release-folder
@ $(cmd_sync) $(dir_build_out)/ $(dir_release)/
release-folder :
@ mkdir -p $(dir_release)
# Recursively invoke Make in the building subdirectory
#
dobuild : ivy-symlink
@ cd $(dir_building) && $(MAKE) DIR_BUILD_ROOT=$(dir_binaries) && cd ..
# Copy the examples in the release folder
#
copy-sample :
@ $(cmd_sync) sample ${dir_release}/
# Make a sym link to Ivy, otherwise stupid Ant does not find it
#
ivy-symlink : /usr/share/ant/lib/ivy.jar
/usr/share/ant/lib/ivy.jar : /usr/share/java/ivy.jar
@ cd $(@D) && sudo ln -s $^
clean :
@ cd $(dir_building) && $(MAKE) DIR_BUILD_ROOT=$(dir_binaries) clean && cd ..
@ rm -rf ${dir_release}
debug :
@ echo $(dir_build_out)
.PHONY : all, clean, dobuild, release, release-folder, copy-sample, debug, ivy-symlink