Add v4l tools to build system

This commit is contained in:
Mutah 2021-05-14 00:23:21 +02:00
parent 3dfaff7df4
commit f36984db0d
2 changed files with 27 additions and 11 deletions

View File

@ -11,7 +11,7 @@ DYN_LIB = $(LIB_DIR)/libfloatimg.so
VERBOSITY = 0 VERBOSITY = 0
all: lib funcs tools all: lib funcs tools v4l2
# shared: $(DYN_LIB) # shared: $(DYN_LIB)
@ -28,14 +28,19 @@ funcs: lib
gcc -shared $(OBJ_DIR)/*.o -lnetpbm -lpnglite -lcfitsio -ltiff -lz -lm -o $(DYN_LIB) gcc -shared $(OBJ_DIR)/*.o -lnetpbm -lpnglite -lcfitsio -ltiff -lz -lm -o $(DYN_LIB)
tools: tools: lib
mkdir -p build/bin mkdir -p build/bin
$(MAKE) -C src/tools $(MAKE) -C src/tools
v4l2:
mkdir -p build/bin
$(MAKE) -C src/v4l2
clean: clean:
$(MAKE) -C src/lib clean $(MAKE) -C src/lib clean
$(MAKE) -C src/funcs clean $(MAKE) -C src/funcs clean
$(MAKE) -C src/tools clean $(MAKE) -C src/tools clean
$(MAKE) -C src/v4l2 clean
rm -rf "./build" rm -rf "./build"
install: all install: all

View File

@ -1,13 +1,24 @@
BIN_DIR = ../../build/bin
STATIC_LIB = ../../build/lib/libfloatimg.a
COPT = -Wall -fpic -g -no-pie -DDEBUG_LEVEL=0 COPT = -Wall -fpic -g -no-pie -DDEBUG_LEVEL=0
DEPS = ../floatimg.h ../libfloatimg.a Makefile
DEPS = ../floatimg.h $(STATIC_LIB) Makefile
LOBJ = funcs.o v4l2_pr_structs.o LOBJ = funcs.o v4l2_pr_structs.o
all: grabvidseq t video-infos nc-camcontrol EXECUTABLES = $(BIN_DIR)/grabvidseq $(BIN_DIR)/video-infos \
$(BIN_DIR)/nc-camcontrol
all: grabvidseq video-infos nc-camcontrol
t: t.c Makefile ${DEPS} funcs.o v4l2_pr_structs.o t: t.c Makefile ${DEPS} funcs.o v4l2_pr_structs.o
gcc ${COPT} $< funcs.o v4l2_pr_structs.o ../libfloatimg.a -o $@ gcc ${COPT} $< funcs.o v4l2_pr_structs.o $(STATIC_LIB) -o $@
clean:
rm -rf $(EXECUTABLES) $(LOBJ)
funcs.o: funcs.c funcs.h Makefile funcs.o: funcs.c funcs.h Makefile
gcc ${COPT} -c $< gcc ${COPT} -c $<
@ -19,20 +30,20 @@ v4l2_pr_structs.o: v4l2_pr_structs.c v4l2_pr_structs.h Makefile
gcc ${COPT} -c $< gcc ${COPT} -c $<
grabvidseq: grabvidseq.c ${DEPS} rgb2fimg.o grabvidseq: grabvidseq.c ${DEPS} rgb2fimg.o
gcc ${COPT} $< rgb2fimg.o ../libfloatimg.a -lpnglite -lz -lm \ gcc ${COPT} $< rgb2fimg.o $(STATIC_LIB) -lpnglite -lz -lm \
-lcfitsio -lv4l2 -ltiff -o $@ -lcfitsio -lv4l2 -ltiff -o $(BIN_DIR)/$@
video-infos: video-infos.c Makefile funcs.o v4l2_pr_structs.o video-infos: video-infos.c Makefile funcs.o v4l2_pr_structs.o
gcc -Wall -g $< ${LOBJ} ../libfloatimg.a -o $@ gcc -Wall -g $< ${LOBJ} $(STATIC_LIB) -o $(BIN_DIR)/$@
nc-camcontrol: nc-camcontrol.c Makefile funcs.o v4l2_pr_structs.o nc-camcontrol: nc-camcontrol.c Makefile funcs.o v4l2_pr_structs.o
gcc -Wall -g $< ${LOBJ} ../libfloatimg.a -lcurses -o $@ gcc -Wall -g $< ${LOBJ} $(STATIC_LIB) -lcurses -o $(BIN_DIR)/$@
# --------------- # ---------------
# external things # external things
capture: capture.c Makefile capture: capture.c Makefile
gcc -Wall -g $< -o $@ gcc -Wall -g $< o $(BIN_DIR)$@