aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYour Name <you@example.com>2024-05-08 10:00:44 -0400
committerYour Name <you@example.com>2024-05-08 10:00:44 -0400
commit5c57d8636f87efedd0d68c2afb8aa99a961a6c8b (patch)
tree3a63787281a5cd2db8e28e1422738976acdd9eb8
parent9ac821480ce9f2d88cbbb9363867760507522ebc (diff)
downloadannotator-5c57d8636f87efedd0d68c2afb8aa99a961a6c8b.tar.gz
annotator-5c57d8636f87efedd0d68c2afb8aa99a961a6c8b.tar.bz2
annotator-5c57d8636f87efedd0d68c2afb8aa99a961a6c8b.zip
Switched makefile format
-rw-r--r--Makefile44
-rw-r--r--annotator.conf4
-rwxr-xr-xconfigure80
-rw-r--r--readme.md1
-rw-r--r--src/labeller.cc1
5 files changed, 17 insertions, 113 deletions
diff --git a/Makefile b/Makefile
index 0d2c34c..d6032e3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,39 +1,23 @@
-CC=g++
LIBS=libconfuse opencv4
-CFLAGS=-c -Wall -fPIC -std=c++20 -Wno-deprecated-enum-enum-conversion
-LDFLAGS=
-SOURCES=src/annotator.cc src/labeller.cc src/playback.cc src/settings.cc src/ui.cc
+override CXXFLAGS += -c -Wall -fPIC -std=c++20 -Wno-deprecated-enum-enum-conversion `pkg-config $(LIBS) --cflags`
+override LDFLAGS += `pkg-config $(LIBS) --libs`
+SOURCES=$(wildcard src/*.cc)
OBJECTS=$(SOURCES:.cc=.o)
-LIBRARY=
+DEPS = $(OBJECTS:.o=.d)
EXECUTABLE=annotator
-ifeq ($(PREFIX),)
- PREFIX := /usr
-endif
-
-all: $(SOURCES) $(EXECUTABLE)
-
-install: $(EXECUTABLE)
- install -d $(DESTDIR)$(PREFIX)/bin/
- install -m 755 $(EXECUTABLE) $(DESTDIR)$(PREFIX)/bin/
+prefix ?= /usr
+exec_prefix ?= $(prefix)
+bindir ?= $(exec_prefix)/bin
$(EXECUTABLE): $(OBJECTS)
- $(CC) $(OBJECTS) -o $@ $(LDFLAGS) `pkg-config $(LIBS) --libs`
-
+ $(CXX) $(OBJECTS) -o $@ $(LDFLAGS)
-src/annotator.o: src/annotator.cc src/playback.h src/ui.h src/labeller.h
- $(CC) $(CFLAGS) $< -o $@ `pkg-config $(LIBS) --cflags`
+-include $(DEPS)
-src/labeller.o: src/labeller.cc src/labeller.h src/settings.h
- $(CC) $(CFLAGS) $< -o $@ `pkg-config $(LIBS) --cflags`
-
-src/playback.o: src/playback.cc src/playback.h
- $(CC) $(CFLAGS) $< -o $@ `pkg-config $(LIBS) --cflags`
-
-src/settings.o: src/settings.cc src/settings.h
- $(CC) $(CFLAGS) $< -o $@ `pkg-config $(LIBS) --cflags`
-
-src/ui.o: src/ui.cc src/ui.h src/playback.h src/labeller.h
- $(CC) $(CFLAGS) $< -o $@ `pkg-config $(LIBS) --cflags`
+install: $(EXECUTABLE)
+ install -d $(DESTDIR)$(bindir)
+ install -m 755 $(EXECUTABLE) $(DESTDIR)$(bindir)
+.PHONY: clean
clean:
- rm -f src/*.o $(LIBRARY) $(EXECUTABLE)
+ $(RM) $(OBJECTS) $(DEPS) $(EXECUTABLE)
diff --git a/annotator.conf b/annotator.conf
index 6ec3ff2..0b2fc03 100644
--- a/annotator.conf
+++ b/annotator.conf
@@ -1,2 +1,2 @@
-labels = {"saccade", "blink", "head move start", "head move end", "look down start", "look down end"}
-rectangles = {"face"}
+labels = {}
+rectangles = {"live", "spoof"}
diff --git a/configure b/configure
deleted file mode 100755
index d4c3daa..0000000
--- a/configure
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/bin/bash
-
-# These are the project-specific variables
-
-EXECUTABLE="annotator"
-
-# e.g., foo.so
-LIBRARY=
-
-# List of libs as given to pkg-config
-LIBS="libconfuse opencv4"
-
-CFLAGS="-c -Wall -fPIC -std=c++20 -Wno-deprecated-enum-enum-conversion"
-
-LDFLAGS=
-
-SOURCE_DIR="src"
-
-EXTRAS=
-
-INSTALL="
-install: \$(EXECUTABLE)
- install -d \$(DESTDIR)\$(PREFIX)/bin/
- install -m 755 \$(EXECUTABLE) \$(DESTDIR)\$(PREFIX)/bin/
-"
-
-# Below here shouldn't need editing
-
-SOURCES=`ls $SOURCE_DIR/*.cc | tr '\n' ' '`
-
-PKG_CONFIG_CFLAGS=
-PKG_CONFIG_LIBS=
-if [ -n "$LIBS" ]; then
- PKG_CONFIG_CFLAGS='`pkg-config $(LIBS) --cflags`'
- PKG_CONFIG_LIBS='`pkg-config $(LIBS) --libs`'
-fi
-
-ALL="all: \$(SOURCES)"
-
-LIBRULE=
-if [ -n "$LIBRARY" ]; then
- LIBRULE="
-\$(LIBRARY): \$(OBJECTS)
- \$(CC) \$(OBJECTS) -shared -o \$@ \$(LDFLAGS) $PKG_CONFIG_LIBS
-"
- ALL="$ALL \$(LIBRARY)"
-fi
-
-EXERULE=
-if [ -n "$EXECUTABLE" ]; then
- EXERULE="
-\$(EXECUTABLE): \$(OBJECTS)
- \$(CC) \$(OBJECTS) -o \$@ \$(LDFLAGS) $PKG_CONFIG_LIBS
-"
- ALL="$ALL \$(EXECUTABLE)"
-fi
-
-ORULES=$(for cc in `ls $SOURCE_DIR/*.cc`; do g++ -MM -MT `cut -d'.' -f-1 <<< $cc`.o $cc; echo -e "\t"'$(CC) $(CFLAGS) $< -o $@ '"$PKG_CONFIG_CFLAGS\n"; done)
-
-cat << EOF > Makefile
-CC=g++
-LIBS=$LIBS
-CFLAGS=$CFLAGS
-LDFLAGS=$LDFLAGS
-SOURCES=$SOURCES
-OBJECTS=\$(SOURCES:.cc=.o)
-LIBRARY=$LIBRARY
-EXECUTABLE=$EXECUTABLE
-ifeq (\$(PREFIX),)
- PREFIX := /usr
-endif
-
-$ALL
-$EXTRAS$INSTALL$LIBRULE$EXERULE
-
-$ORULES
-
-clean:
- rm -f $SOURCE_DIR/*.o \$(LIBRARY) \$(EXECUTABLE)
-EOF
diff --git a/readme.md b/readme.md
index fbe37c7..b69a2fb 100644
--- a/readme.md
+++ b/readme.md
@@ -12,7 +12,6 @@ Requirements are:
Compile by running:
```console
-./configure
make
```
diff --git a/src/labeller.cc b/src/labeller.cc
index d64ac93..f111c3a 100644
--- a/src/labeller.cc
+++ b/src/labeller.cc
@@ -2,6 +2,7 @@
#include "settings.h"
#include <fstream>
#include <iostream>
+#include <algorithm>
namespace backend {
struct labeller_impl {