shepherd/Makefile
jedi 8342cc7742
All checks were successful
continuous-integration/appveyor/branch AppVeyor build succeeded
add badge
2020-05-26 14:00:14 +02:00

52 lines
1.1 KiB
Makefile

CC = gcc
CXX = g++
LD = g++
CXXFLAGS = -std=c++17 -Wall -Werror -Wpointer-arith -Wfatal-errors
CFLAGS = -Wall -Werror -Wpointer-arith -Wfatal-errors
DEBUG = -g
prefix=/usr/local
OBJECTS = build/memdb.o build/spmemvfs.o build/crypto.o build/Manager.o build/Database.o
all: build/shepherd
build/shepherd: build/shepherd.o $(OBJECTS)
@mkdir -p $(dir $@)
@echo link $@
@$(LD) $(CXXFLAGS) $^ -o $@ -lsqlite3 -lsodium -lstdc++fs
build/test: build/testmemvfs.o $(OBJECTS)
@mkdir -p $(dir $@)
@echo link $@
@$(LD) $(CXXFLAGS) $^ -o $@ -lsqlite3 -lsodium -lstdc++fs
build/%.o: src/%.cpp src/%.h
@mkdir -p $(dir $@)
@echo complie $@
@$(CXX) $(CXXFLAGS) -c -o $@ $<
build/%.o: src/%.c src/%.h
@mkdir -p $(dir $@)
@echo compile $@
@$(CC) $(CFLAGS) -c -o $@ $<
rsa: rsa.cpp
@mkdir -p bin
$(CC) $(CFLAGS) rsa.cpp -o bin/rsa -lssl -lcrypto
install: build/shepherd
install -m 0755 $@ $(prefix)/bin
.PHONY: test
test:
test/test.sh test/test.db
# remove produced files, invoke as "make clean"
clean:
@echo clean build*
@rm -f build/*
#%.o : %.cpp
# $(CC) $(CFLAGS) -c $^ -o $@