-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
108 lines (94 loc) · 3.36 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
################################################################################
# #
# M A K E F I L E #
# #
################################################################################
################################################################################
#
# Description: This is just a convenience makefile that points to the actual
# makefile and executes.
#
# Directory Structure:
# /CaptionInspector/
# |
# +---/include/{All Include Files}
# |
# +---/obj/{All Generated Object and Dependency Files}
# |
# +---/python/{Python Code}
# | |
# | +-----/libci.dylib (Generated Dynamic Library for use with Python)
# | |
# | +-----/Makefile (Convenience Makefile that just points to this makefile)
# |
# +---/src/
# | |
# | +--/source/{Source Files for the Sources}
# | |
# | +--/xform/{Source Files for the Transforms}
# | |
# | +--/sink/{Source Files for the Sinks}
# | |
# | +--/utils/{Source Files for the Utilities}
# | |
# | +--/makefile (Actual Makefile)
# |
# +---/test/{C Test Code}
# | |
# | +-----/libci-test.dylib (Generated Dynamic Test Library for use with Python Tests)
# | |
# | +-----/python/{Python Test Code}
# | |
# | +-----/Makefile (Test Makefile)
# |
# +---/makefile (Convenience Makefile that just points to the actual makefile)
# | ^^^^^^^
# | YOU ARE HERE!
# |
# +---/caption-inspector (Generated Binary Executable)
#
################################################################################
ifeq (run,$(firstword $(MAKECMDGOALS)))
# use the rest as arguments for "run"
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
# ...and turn them into do-nothing targets
$(eval $(RUN_ARGS):;@:)
endif
.PHONY: all sharedlib clean build docker example
all:
cd src ; make all
sharedlib:
cd src ; make sharedlib
caption-inspector:
cd src ; make ../caption-inspector
ci_without_ffmpeg:
cd src ; make ci_without_ffmpeg
ci_with_gpac:
cd src ; make ci_with_gpac
docker:
docker build -t caption-inspector .
docker-test:
cd test ; make docker
clean:
cd src ; make clean
VERSION_CLEANUP=make version-cleanup || { make version-cleanup; exit 1; }
GIT_VERSION = $(shell git describe --match "v[0-9]*" --always --long | sed -e "s/-.*//")
GIT_BUILD = $(shell git describe --match "v[0-9]*" --always --long)
GIT_COMMIT = $(shell git describe --match "v[0-9]*" --always --long | sed -e "s/.*-g//")
GIT_COMMIT_LONG = $(shell git describe --match "v[0-9]*" --long --abbrev=40 | sed -e "s/.*-g//")
define VERSION_BODY
// this file generated by build process
const char* VERSION = "${GIT_VERSION}";
const char* BUILD = "${GIT_BUILD}";
const char* COMMIT = "${GIT_COMMIT}";
const char* COMMIT_LONG = "${GIT_COMMIT_LONG}";
endef
export VERSION_BODY
.PHONY: version version-cleanup src/utils/version.c
version: src/utils/version.c
src/utils/version.c:
@echo "Building Version: ${GIT_VERSION} (${GIT_BUILD})"
git describe --match "v[0-9]*" --always --long
@echo "$$VERSION_BODY" > $@
version-cleanup:
git checkout -- src/utils/version.c