You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
1.6 KiB

# .SILENT:
DEPENDFILE=.depend
VERSION=0.1
PREFIX=/usr/local
DATAPREFIX=/var/lib
RUNPID=/var/run/miniwebcam.pid
ETCPREFIX=/etc
DEFAULT_SERVERPORT=20010
CXX=g++
CXXFLAGS= -ggdb -fPIC -Wall -std=c++11 -I/usr/local/include
LDFLAGS= -lUDPTCPNetwork -L/usr/local/lib -ljpeg
OBJFILES= webserver.o configuration.o main.o inmemoryfile.o \
convert.o debayer.o videoframe.o \
video.o videodevice_v4l2.o videodevice_dump.o
all: dep miniwebcam
miniwebcam: $(OBJFILES)
$(CXX) $(OBJFILES) -o $@ -L./ -I./ $(LDFLAGS)
install: miniwebcam
cp -rf miniwebcam $(PREFIX)/bin
uninstall:
rm -rf $(PREFIX)/bin/miniwebcam
config:
echo "#ifndef _CONFIG_H_" > config.h
echo "#define _CONFIG_H_" >> config.h
echo "" >> config.h
echo "#define VERSION \"$(VERSION)\"" >> config.h
echo "" >> config.h
echo "#define PREFIX \"$(PREFIX)\"" >> config.h
echo "#define RUNPID \"$(RUNPID)\"" >> config.h
echo "#define ETCPREFIX \"$(ETCPREFIX)\"" >> config.h
echo "" >> config.h
echo "#define DEFAULT_SERVERPORT \""$(DEFUALT_SERVERPORT)"\"" >> config.h
echo "" >> config.h
echo "#endif" >> config.h
echo "" >> config.h
rebuild: clean all
dep:
$(CXX) -MM `ls *.cc` $(CXXFLAGS) > $(DEPENDFILE)
keygen:
openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout ssl-key.pem -out ssl-cert.pem
clean:
rm *.s -rf
rm *.o -rf
rm *.oo -rf
rm *~ -rf
rm -rf .depend
rm -rf *.so
rm -rf *.so.*
rm -rf miniwebcam
rm -rf config.h
rm -rf Makefile.rules
rm -rf ssl-key.pem
rm -rf ssl-cert.pem
cleanall: clean
source: cleanall
help:
echo " config to create a new config.h file"
echo " keygen generate a key and a self-signed certificate"
-include $(DEPENDFILE)