-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (25 loc) · 805 Bytes
/
Makefile
File metadata and controls
34 lines (25 loc) · 805 Bytes
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
PREFIX=/usr/local
DESTDIR=
version=$(shell git describe --tags 2> /dev/null || echo "no-version")
GOFLAGS=-ldflags "-X github.com/hydronica/task_ffmpeg.Version=${version} -X github.com/hydronica/task_ffmpeg.BuildTimeUTC=`date -u '+%Y-%m-%d_%I:%M:%S%p'`"
BLDDIR = deploy/bin
EXT=
ifeq (${GOOS},windows)
EXT=.exe
endif
APPS = info encoder
all: $(APPS)
$(BLDDIR)/info: $(wildcard apps/workers/info/*.go)
$(BLDDIR)/encoder: $(wildcard apps/workers/encoder/*.go)
$(BLDDIR)/%: clean
@mkdir -p $(dir $@)
go build ${GOFLAGS} -o $@ ./apps/*/$*
$(APPS): %: $(BLDDIR)/%
clean:
rm -rf $(BLDDIR)
.PHONY: install clean all
.PHONY: $(APPS)
install: $(APPS)
install -m 755 -d ${DESTDIR}${BINDIR}
for APP in $^ ; do install -m 755 ${BLDDIR}/$$APP ${DESTDIR}${BINDIR}/$$APP${EXT} ; done
rm -rf build