2019-03-28 10:39:24 +00:00
|
|
|
CC = gcc
|
|
|
|
CXX = g++
|
|
|
|
LD = g++
|
|
|
|
CXXFLAGS = -std=c++17 -Wall -Werror -Wpointer-arith -Wfatal-errors
|
|
|
|
CFLAGS = -Wall -Werror -Wpointer-arith -Wfatal-errors
|
2016-01-28 14:37:39 +00:00
|
|
|
|
2020-12-14 19:30:28 +00:00
|
|
|
#prefix=/usr/local
|
2016-01-28 14:37:39 +00:00
|
|
|
|
2019-03-28 10:39:24 +00:00
|
|
|
OBJECTS = build/memdb.o build/spmemvfs.o build/crypto.o build/Manager.o build/Database.o
|
2016-01-28 14:37:39 +00:00
|
|
|
|
2020-12-14 19:30:28 +00:00
|
|
|
all: shepherd
|
2019-03-28 10:39:24 +00:00
|
|
|
|
|
|
|
build/shepherd: build/shepherd.o $(OBJECTS)
|
|
|
|
@mkdir -p $(dir $@)
|
2020-05-26 12:00:14 +00:00
|
|
|
@echo link $@
|
2019-03-28 10:39:24 +00:00
|
|
|
@$(LD) $(CXXFLAGS) $^ -o $@ -lsqlite3 -lsodium -lstdc++fs
|
|
|
|
|
2020-12-14 19:30:28 +00:00
|
|
|
build/test: build/shepherd.o $(OBJECTS)
|
2019-03-28 10:39:24 +00:00
|
|
|
@mkdir -p $(dir $@)
|
2020-05-26 12:00:14 +00:00
|
|
|
@echo link $@
|
2019-03-28 10:39:24 +00:00
|
|
|
@$(LD) $(CXXFLAGS) $^ -o $@ -lsqlite3 -lsodium -lstdc++fs
|
|
|
|
|
|
|
|
build/%.o: src/%.cpp src/%.h
|
|
|
|
@mkdir -p $(dir $@)
|
2020-12-14 19:30:28 +00:00
|
|
|
@echo compile $@
|
2019-03-28 10:39:24 +00:00
|
|
|
@$(CXX) $(CXXFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
build/%.o: src/%.c src/%.h
|
|
|
|
@mkdir -p $(dir $@)
|
2020-05-26 12:00:14 +00:00
|
|
|
@echo compile $@
|
2019-03-28 10:39:24 +00:00
|
|
|
@$(CC) $(CFLAGS) -c -o $@ $<
|
2016-01-28 14:37:39 +00:00
|
|
|
|
2016-01-28 17:06:36 +00:00
|
|
|
rsa: rsa.cpp
|
2019-03-28 10:39:24 +00:00
|
|
|
@mkdir -p bin
|
2016-01-28 17:06:36 +00:00
|
|
|
$(CC) $(CFLAGS) rsa.cpp -o bin/rsa -lssl -lcrypto
|
2016-01-28 14:37:39 +00:00
|
|
|
|
2019-03-28 10:39:24 +00:00
|
|
|
install: build/shepherd
|
2020-12-14 19:30:28 +00:00
|
|
|
install -m 0755 $^ $(DESTDIR)/usr/bin
|
|
|
|
|
|
|
|
shepherd: build/shepherd
|
2016-01-28 14:37:39 +00:00
|
|
|
|
2020-12-14 19:30:28 +00:00
|
|
|
#.PHONY: test
|
|
|
|
#test: build/test
|
|
|
|
# test/test.sh test/test.db
|
2018-09-05 19:51:13 +00:00
|
|
|
|
2016-01-28 14:37:39 +00:00
|
|
|
# remove produced files, invoke as "make clean"
|
2019-03-28 10:39:24 +00:00
|
|
|
clean:
|
2020-12-14 19:30:28 +00:00
|
|
|
@echo clean build/*
|
2019-03-28 10:39:24 +00:00
|
|
|
@rm -f build/*
|
2018-09-05 19:51:13 +00:00
|
|
|
|
|
|
|
#%.o : %.cpp
|
|
|
|
# $(CC) $(CFLAGS) -c $^ -o $@
|
2020-05-26 12:00:14 +00:00
|
|
|
|