forked from happycube/ld-decode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (56 loc) · 2.13 KB
/
Copy pathMakefile
File metadata and controls
79 lines (56 loc) · 2.13 KB
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
### Top-level Makefile for ld-decode ###
# Prefix into which ld-decode will be installed.
# This must be set both at build and install time. If you're using a
# non-default directory here, make sure that Python knows to look in there for
# modules (e.g. by setting PYTHONPATH in your environment).
prefix ?= /usr/local
# Staging dir for building distribution packages.
# If you're building packages, it may make more sense to build the Python and
# Qt parts using your distribution's tools, rather than using this Makefile
# (but don't forget the helpers!).
DESTDIR =
# Tools you might want to override
PYTHON3 ?= python3
QMAKE ?= qmake
### Get the current git commit information ###
BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
COMMIT = $(shell git rev-parse --short HEAD)
### Targets for users to invoke ###
all: build-helpers build-python build-tools
install: install-helpers install-python install-tools
clean: clean-helpers clean-python clean-tools
.PHONY: all build-helpers build-python build-tools
.PHONY: install install-helpers install-python install-tools
.PHONY: clean clean-helpers clean-python clean-tools
### Helper programs used by ld-decode ###
helpers = ld-ldf-reader
build-helpers: $(helpers)
ld-ldf-reader: ld-ldf-reader.c
$(CC) -O2 -Wno-deprecated-declarations -o $@ $< -lavcodec -lavutil -lavformat
install-helpers:
install -d "$(DESTDIR)$(prefix)/bin"
install -m755 $(helpers) "$(DESTDIR)$(prefix)/bin"
clean-helpers:
rm -f $(helpers)
### Python modules and scripts ###
build-python:
$(PYTHON3) setup.py build
install-python:
if [ -z "$(DESTDIR)" ]; then \
$(PYTHON3) setup.py install --prefix="$(prefix)"; \
else \
$(PYTHON3) setup.py install --root="$(DESTDIR)" --prefix="$(prefix)"; \
fi
clean-python:
$(PYTHON3) setup.py clean -a
### Qt-based tools ###
build-tools:
cd tools && $(QMAKE) -recursive PREFIX="$(prefix)" BRANCH="$(BRANCH)" COMMIT="$(COMMIT)"
$(MAKE) -C tools
install-tools:
$(MAKE) -C tools install INSTALL_ROOT="$(DESTDIR)"
clean-tools:
$(MAKE) -C tools clean
### Generated files, not updated automatically ###
tools/library/filter/deemp.h: scripts/filtermaker
$(PYTHON3) scripts/filtermaker >$@