Browse Source

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

master
heck 4 months ago
parent
commit
ef5bc0a7c0
27 changed files with 50 additions and 35 deletions
  1. +9
    -32
      Makefile
  2. +1
    -0
      Makefile.conf
  3. +0
    -0
      src/Adapter.cc
  4. +0
    -0
      src/Adapter.hh
  5. +0
    -0
      src/Adapter.hxx
  6. +37
    -0
      src/Makefile
  7. +0
    -0
      src/Semaphore.hh
  8. +0
    -0
      src/call_with_lock.cc
  9. +0
    -0
      src/call_with_lock.hh
  10. +0
    -0
      src/callback_dispatcher.cc
  11. +0
    -0
      src/callback_dispatcher.hh
  12. +0
    -0
      src/constant_time_algo.cc
  13. +0
    -0
      src/constant_time_algo.hh
  14. +0
    -0
      src/locked_queue.hh
  15. +0
    -0
      src/message_cache.cc
  16. +0
    -0
      src/message_cache.hh
  17. +0
    -0
      src/pEpLog.cc
  18. +0
    -0
      src/pEpLog.hh
  19. +0
    -0
      src/passphrase_cache.cc
  20. +0
    -0
      src/passphrase_cache.hh
  21. +0
    -0
      src/passphrase_cache.hxx
  22. +0
    -0
      src/pc_container.hh
  23. +0
    -0
      src/slurp.cc
  24. +0
    -0
      src/slurp.hh
  25. +0
    -0
      src/status_to_string.cc
  26. +0
    -0
      src/status_to_string.hh
  27. +3
    -3
      test/Makefile

+ 9
- 32
Makefile View File

@ -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
- 0
Makefile.conf View File

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


Adapter.cc → src/Adapter.cc View File


Adapter.hh → src/Adapter.hh View File


Adapter.hxx → src/Adapter.hxx View File


+ 37
- 0
src/Makefile View File

@ -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)

Semaphore.hh → src/Semaphore.hh View File


call_with_lock.cc → src/call_with_lock.cc View File


call_with_lock.hh → src/call_with_lock.hh View File


callback_dispatcher.cc → src/callback_dispatcher.cc View File


callback_dispatcher.hh → src/callback_dispatcher.hh View File


constant_time_algo.cc → src/constant_time_algo.cc View File


constant_time_algo.hh → src/constant_time_algo.hh View File


locked_queue.hh → src/locked_queue.hh View File


message_cache.cc → src/message_cache.cc View File


message_cache.hh → src/message_cache.hh View File


pEpLog.cc → src/pEpLog.cc View File


pEpLog.hh → src/pEpLog.hh View File


passphrase_cache.cc → src/passphrase_cache.cc View File


passphrase_cache.hh → src/passphrase_cache.hh View File


passphrase_cache.hxx → src/passphrase_cache.hxx View File


pc_container.hh → src/pc_container.hh View File


slurp.cc → src/slurp.cc View File


slurp.hh → src/slurp.hh View File


status_to_string.cc → src/status_to_string.cc View File


status_to_string.hh → src/status_to_string.hh View File


+ 3
- 3
test/Makefile View File

@ -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