Browse Source

Makefile structure similar to engine, recursively specializing local.conf with defaults in Makefile.conf

JNI-88
heck 3 years ago
parent
commit
41fb26b250
4 changed files with 40 additions and 38 deletions
  1. +21
    -0
      Makefile
  2. +8
    -17
      Makefile.conf
  3. +9
    -7
      README.md
  4. +2
    -14
      src/Makefile

+ 21
- 0
Makefile View File

@ -1,3 +1,24 @@
# Copyright 2017, pEp Foundation
# This file is part of pEp JNI Adapter
# This file may be used under the terms of the GNU General Public License version 3
# see LICENSE.txt
HERE_REL := $(notdir $(CURDIR))
include Makefile.conf
ifneq ($(wildcard local.conf),)
$(info ================================================)
$(info Overrides in `local.conf` are used.)
$(info ================================================)
endif
ifdef BUILD_CONFIG
$(info ================================================)
$(info Overrides in `$(BUILD_CONFIG)` are used.)
$(info ================================================)
endif
.PHONY: all src test clean
all: src test


src/Makefile.conf → Makefile.conf View File


+ 9
- 7
README.md View File

@ -26,9 +26,13 @@ sudo port install openjdk11
~~~
## Building
Customization of the build can be done in `src/Makefile.conf`, or in a file `src/local.conf` which is not part of the source code distribution.
An example `src/local.conf` looks like this:
Build configuration will be the result of including these files in the following order:
* `Makefile.conf` - Defaults
* `local.conf` - optional cfg (overwrites existing values)
* `src/local.conf`- optional cfg for src dir (overwrites existing values)
An example `local.conf` looks like this:
~~~
JAVA_HOME=/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home
@ -49,15 +53,13 @@ Now, build the Adapter with
On Linux:
~~~
cd src
make
make src
~~~
On macOS:
~~~
cd src
gmake
make src
~~~
(The GNU Make distributed with macOS is too old, install GNU Make "gmake" from macPorts).
(The GNU Make distributed with macOS might be too old, in this case install GNU Make "gmake" from macPorts).

+ 2
- 14
src/Makefile View File

@ -3,19 +3,7 @@
# This file may be used under the terms of the GNU General Public License version 3
# see LICENSE.txt
include Makefile.conf
ifneq ($(wildcard local.conf),)
$(info ================================================)
$(info Overrides in `local.conf` are used.)
$(info ================================================)
endif
ifdef BUILD_CONFIG
$(info ================================================)
$(info Overrides in `$(BUILD_CONFIG)` are used.)
$(info ================================================)
endif
include ../Makefile.conf
ifndef JAVA_HOME
$(error JAVA_HOME is not set!)
@ -37,7 +25,7 @@ ifeq ($(BUILD_FOR),Linux)
else ifeq ($(BUILD_FOR),Darwin)
SHARED=libpEpJNI.dylib
else
$(error I don't know how to build for $(BUILD_FOR).)
$(error I dont know how to build for $(BUILD_FOR).)
endif
JAVA_SOURCES=foundation/pEp/jniadapter/AbstractEngine.java \


Loading…
Cancel
Save