Browse Source

LIB-13: Standard project layout (src dir added)

pull/8/head
heck 4 years ago
parent
commit
ef5bc0a7c0
  1. 41
      Makefile
  2. 1
      Makefile.conf
  3. 0
      src/Adapter.cc
  4. 0
      src/Adapter.hh
  5. 0
      src/Adapter.hxx
  6. 37
      src/Makefile
  7. 0
      src/Semaphore.hh
  8. 0
      src/call_with_lock.cc
  9. 0
      src/call_with_lock.hh
  10. 0
      src/callback_dispatcher.cc
  11. 0
      src/callback_dispatcher.hh
  12. 0
      src/constant_time_algo.cc
  13. 0
      src/constant_time_algo.hh
  14. 0
      src/locked_queue.hh
  15. 0
      src/message_cache.cc
  16. 0
      src/message_cache.hh
  17. 0
      src/pEpLog.cc
  18. 0
      src/pEpLog.hh
  19. 0
      src/passphrase_cache.cc
  20. 0
      src/passphrase_cache.hh
  21. 0
      src/passphrase_cache.hxx
  22. 0
      src/pc_container.hh
  23. 0
      src/slurp.cc
  24. 0
      src/slurp.hh
  25. 0
      src/status_to_string.cc
  26. 0
      src/status_to_string.hh
  27. 6
      test/Makefile

41
Makefile

@ -3,45 +3,22 @@
# This file may be used under the terms of the GNU General Public License version 3
# see LICENSE.txt
include Makefile.conf
.PHONY: src test install uninstall clean
TARGET=libpEpAdapter.a
all: src
.PHONY: install uninstall clean
src:
$(MAKE) -C src
SOURCE=$(wildcard *.cc)
HEADERS=$(wildcard *.hh *.hxx)
OBJECTS=$(subst .cc,.o,$(SOURCE))
DEPENDS=$(subst .cc,.d,$(SOURCE))
CXXFLAGS+= -MMD -MP
all: $(TARGET)
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPENDS)
endif
lib: $(TARGET)
all: lib
test: lib
test: src
$(MAKE) -C test
$(TARGET): $(OBJECTS)
$(AR) -rc $@ $^
clean:
rm -vf $(TARGET) $(OBJECTS) $(DEPENDS)
rm -f *.d.*
$(MAKE) -C src clean
$(MAKE) -C test clean
install: $(TARGET)
mkdir -p $(PREFIX)/include/pEp
mkdir -p $(PREFIX)/lib
cp -v $(HEADERS) $(PREFIX)/include/pEp/
cp -v $(TARGET) $(PREFIX)/lib/
install:
$(MAKE) -C src install
uninstall:
cd $(PREFIX)/include/pEp && rm -vf $(HEADERS)
cd $(PREFIX)/lib && rm -vf $(TARGET)
$(MAKE) -C src uninstall

1
Makefile.conf

@ -5,6 +5,7 @@
HERE:=$(dir $(lastword $(MAKEFILE_LIST)))
TARGET=libpEpAdapter.a
# Defaults
DEBUG=1

0
Adapter.cc → src/Adapter.cc

0
Adapter.hh → src/Adapter.hh

0
Adapter.hxx → src/Adapter.hxx

37
src/Makefile

@ -0,0 +1,37 @@
# Copyright 2018, pEp Foundation
# This file is part of lib pEp Adapter
# This file may be used under the terms of the GNU General Public License version 3
# see LICENSE.txt
include ../Makefile.conf
SOURCE=$(wildcard *.cc)
HEADERS=$(wildcard *.hh *.hxx)
OBJECTS=$(subst .cc,.o,$(SOURCE))
DEPENDS=$(subst .cc,.d,$(SOURCE))
CXXFLAGS+= -MMD -MP
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPENDS)
endif
.PHONY: install uninstall clean
all: $(TARGET)
$(TARGET): $(OBJECTS)
$(AR) -rc $@ $^
clean:
rm -vf $(TARGET) $(OBJECTS) $(DEPENDS)
rm -f *.d.*
install: $(TARGET)
mkdir -p $(PREFIX)/include/pEp
mkdir -p $(PREFIX)/lib
cp -v $(HEADERS) $(PREFIX)/include/pEp/
cp -v $(TARGET) $(PREFIX)/lib/
uninstall:
cd $(PREFIX)/include/pEp && rm -vf $(HEADERS)
cd $(PREFIX)/lib && rm -vf $(TARGET)

0
Semaphore.hh → src/Semaphore.hh

0
call_with_lock.cc → src/call_with_lock.cc

0
call_with_lock.hh → src/call_with_lock.hh

0
callback_dispatcher.cc → src/callback_dispatcher.cc

0
callback_dispatcher.hh → src/callback_dispatcher.hh

0
constant_time_algo.cc → src/constant_time_algo.cc

0
constant_time_algo.hh → src/constant_time_algo.hh

0
locked_queue.hh → src/locked_queue.hh

0
message_cache.cc → src/message_cache.cc

0
message_cache.hh → src/message_cache.hh

0
pEpLog.cc → src/pEpLog.cc

0
pEpLog.hh → src/pEpLog.hh

0
passphrase_cache.cc → src/passphrase_cache.cc

0
passphrase_cache.hh → src/passphrase_cache.hh

0
passphrase_cache.hxx → src/passphrase_cache.hxx

0
pc_container.hh → src/pc_container.hh

0
slurp.cc → src/slurp.cc

0
slurp.hh → src/slurp.hh

0
status_to_string.cc → src/status_to_string.cc

0
status_to_string.hh → src/status_to_string.hh

6
test/Makefile

@ -1,8 +1,8 @@
include ../Makefile.conf
LDFLAGS=-L../ $(ENGINE_LIB)
LDFLAGS=-L../src $(ENGINE_LIB)
LDLIBS=-lstdc++ -lpEpEngine -lpEpAdapter
CXXFLAGS+=-I../ $(ENGINE_INC) -std=c++11 -DENGINE_TEST=$(ENGINE_TEST)
CXXFLAGS+=-I../src $(ENGINE_INC) -std=c++11 -DENGINE_TEST=$(ENGINE_TEST)
SRC=$(wildcard test_*.cc)
TST=$(subst .cc,,$(SRC))
@ -13,7 +13,7 @@ $(TST): framework.o
.PHONY: clean rmtestdata
clean:
clean:
rm -f $(TST)
rm -Rf *.dSYM
rm -f *.o

Loading…
Cancel
Save