Browse Source

Tried minimizing makefile complexity, clean out unused stuff.

now:
'make' defaults to 'make lib'
'make lib' - build static lib only
'make test' - build tests with lib as prereq.
'make all' - same as 'make test'

test changes to lib using e.g:
'make test && test/test_adapter'
sync
heck 6 years ago
parent
commit
e9d5c27bc0
  1. 15
      Makefile
  2. 4
      Makefile.conf
  3. 7
      test/Makefile

15
Makefile

@ -17,25 +17,26 @@ ifdef BUILD_CONFIG
$(info ================================================) $(info ================================================)
endif endif
.PHONY: all, clean, distclean, test, install, uninstall .PHONY: all, lib, test, install, uninstall, clean
SOURCE=$(wildcard *.cc) SOURCE=$(wildcard *.cc)
HEADERS=$(wildcard *.hh *.hxx) HEADERS=$(wildcard *.hh *.hxx)
OBJECTS=$(subst .cc,.o,$(SOURCE)) OBJECTS=$(subst .cc,.o,$(SOURCE))
TARGET=libpEpAdapter.a TARGET=libpEpAdapter.a
all: $(TARGET) lib: $(TARGET)
all: lib test
test: lib
$(MAKE) -C test all
$(TARGET): $(OBJECTS) $(TARGET): $(OBJECTS)
$(AR) -rc $@ $^ $(AR) -rc $@ $^
clean: clean:
rm -vf $(TARGET) $(OBJECTS) rm -vf $(TARGET) $(OBJECTS)
# rm -rvf .gnupg/ $(MAKE) -C test clean
# rm -vf .pEp_management.db*
# distclean: clean
# rm -Rvf .gnupg .pEp_management*
install: $(TARGET) install: $(TARGET)
mkdir -p $(PREFIX)/include/pEp mkdir -p $(PREFIX)/include/pEp

4
Makefile.conf

@ -4,15 +4,13 @@
# see LICENSE.txt # see LICENSE.txt
######### Header ######### ######### Header #########
HERE:=$(dir $(lastword $(MAKEFILE_LIST))) HERE:= $(notdir $(CURDIR))
######### General ######### ######### General #########
BUILD_FOR:=$(shell uname) BUILD_FOR:=$(shell uname)
PREFIX=$(HOME) PREFIX=$(HOME)
######### C and C++ ######### ######### C and C++ #########
#LDFLAGS=-L. $(ENGINE_LIB)
#LDLIBS=-lstdc++ -lpEpEngine -lpEpAdapter
CXXFLAGS=-std=c++11 CXXFLAGS=-std=c++11
######### C++ ######### ######### C++ #########

7
test/Makefile

@ -4,12 +4,17 @@ LDFLAGS=-L../ $(ENGINE_LIB)
LDLIBS=-lstdc++ -lpEpEngine -lpEpAdapter LDLIBS=-lstdc++ -lpEpEngine -lpEpAdapter
CXXFLAGS+=-I../ CXXFLAGS+=-I../
.PHONY=all, test_adapter, test_library
all: test_adapter test_library all: test_adapter test_library
test_adapter: ../libpEpAdapter.a test_adapter: test_adapter.cc ../libpEpAdapter.a
test_library: test_library.cc ../libpEpAdapter.a
clean: clean:
rm -vf test_adapter rm -vf test_adapter
rm -rvf test_adapter.dSYM rm -rvf test_adapter.dSYM
rm -vf test_library rm -vf test_library
rm -rvf test_library.dSYM rm -rvf test_library.dSYM

Loading…
Cancel
Save