-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (47 loc) · 1.32 KB
/
Copy pathMakefile
File metadata and controls
64 lines (47 loc) · 1.32 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
include ./rules.make
TOP_DIR ?= $(shell pwd)
SUBDIRS=utils libavpipe exc elvxc cmd/mvhevc
SRCS=avpipe_handler.c
OBJS=$(SRCS:%.c=$(BINDIR)/%.o)
.PHONY: all test gotest ctest clean
.DEFAULT_GOAL := dynamic
all install: check-env
@for dir in $(SUBDIRS); do \
echo "Making $@ in $$dir..."; \
(cd $$dir; make $@) || exit 1; \
done
dynamic: all
# goclean: nuclear option to reset all caches. Normally not needed — the C sources
# compiled by cgo are embedded via //go:embed in avpipe_cgo_sources.go, so editing
# any of them triggers an automatic Go rebuild (no `make` or cache clean required).
goclean: clean
@go clean -cache -testcache -modcache -i -r
clean: lclean
@for dir in $(SUBDIRS); do \
echo "Making $@ in $$dir..."; \
(cd $$dir; make $@) || exit 1; \
done
avpipe:
go build -v
mkdir -p ./O
libavpipego: $(OBJS)
@(if [ ! -d $(LIBDIR) ]; then mkdir $(LIBDIR); fi)
@echo Making libavpipe_handler
@ld -r -o $(LIBDIR)/libavpipe_handler.a $?
$(BINDIR)/%.o: %.c
@(if [ ! -d $(BINDIR) ]; then mkdir $(BINDIR); fi)
@echo "Compiling " $<
gcc ${CFLAGS} ${LDFLAGS} ${INCDIRS} -c $< -o $@
lclean:
@rm -rf lib bin include
clean_test:
@rm -rf test_out avpipe-test*.log
check-env:
ifndef FFMPEG_DIST
$(error FFMPEG_DIST is undefined)
endif
test: ctest gotest
gotest:
@./run_go_tests.sh
ctest:
@$(MAKE) -C libavpipe test