shepherd/Makefile

52 lines
1.1 KiB
Makefile
Raw Normal View History

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
DEBUG = -g
prefix=/usr/local
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
2019-03-28 10:39:24 +00:00
all: build/shepherd build/test
build/shepherd: build/shepherd.o $(OBJECTS)
@mkdir -p $(dir $@)
@echo "\n->"$@
@$(LD) $(CXXFLAGS) $^ -o $@ -lsqlite3 -lsodium -lstdc++fs
build/test: build/testmemvfs.o $(OBJECTS)
@mkdir -p $(dir $@)
@echo "\n->"$@
@$(LD) $(CXXFLAGS) $^ -o $@ -lsqlite3 -lsodium -lstdc++fs
build/%.o: src/%.cpp src/%.h
@mkdir -p $(dir $@)
@echo -n $@" "
@$(CXX) $(CXXFLAGS) -c -o $@ $<
build/%.o: src/%.c src/%.h
@mkdir -p $(dir $@)
@echo -n $@" "
@$(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
install -m 0755 $@ $(prefix)/bin
2016-01-28 14:37:39 +00:00
2018-09-05 19:51:13 +00:00
.PHONY: test
test:
test/test.sh test/test.db
2016-01-28 14:37:39 +00:00
# remove produced files, invoke as "make clean"
2019-03-28 10:39:24 +00:00
clean:
@echo clean build*
@rm -f build/*
2018-09-05 19:51:13 +00:00
#%.o : %.cpp
# $(CC) $(CFLAGS) -c $^ -o $@