Merge branch 'makefile-conf'

pull/2/head
heck 2 years ago
commit cd0e3d3742

3
.gitignore vendored

@ -166,3 +166,6 @@ src/transport_status_code.h
src/transport_status_code.c
src/TransportStatusCode.kt
# Local configuration
src/local.conf
/local.conf

@ -0,0 +1,19 @@
.PHONY: src test install uninstall clean
all: src
src:
$(MAKE) -C src
#test: src
# $(MAKE) -C test
clean:
$(MAKE) -C src clean
# $(MAKE) -C test clean
install:
$(MAKE) -C src install
uninstall:
$(MAKE) -C src uninstall

@ -0,0 +1,18 @@
# Copyright 2021, pEp Foundation
#
# This file may be used under the terms of the GNU General Public License version 3
# see ../LICENSE.txt
######### Header #########
HERE:=$(dir $(lastword $(MAKEFILE_LIST)))
# Build config
# Defaults
PREFIX?=$(HOME)
YML2_PATH=$(HOME)/yml2
YML2_PROC=$(YML2_PATH)/yml2proc $(YML2_OPTS)
YML2_OPTS=--encoding=utf8
# Overrides
-include $(HERE)local.conf

@ -2,7 +2,36 @@
Interfacing between transports written in different programming languages
## build dependencies
## Build dependencies
* YML 2.7.1
## Build Configuration
The build configuration file is called `local.conf`.
Use the file `local.conf.example` as a template.
```bash
cp local.conf.example local.conf
```
Then, tweak it to your needs.
## Make Targets
The default make target is `src`.
### Build
* `make src`
Generates all the headers and source files
### Install
* `make install`
Installs the header files in $PREFIX/include/pEp
* `make uninstall`
Removes all headers from $PREFIX/include/pEp
### Clean
* `make clean`
- YML 2.7.1

@ -0,0 +1,10 @@
# This is an Example build config file (local.conf)
# you might not need this file, but if the defaults dont work for you
# You can override them here.
# Tweak the values to your needs and rename it to local.conf
############# DIRS #############
# PREFIX=$(HOME)/local
# YML2_PATH=$(HOME)/yml2
# YML2_PROC=$(YML2_PATH)/yml2proc $(YML2_OPTS)
# YML2_OPTS=--encoding=utf8

@ -1,24 +1,34 @@
YML2PROC?=yml2proc
include ../Makefile.conf
TARGET=transport_status_code.h transport_status_code.c PEPTransportStatusCode.h TransportStatusCode.kt
HEADERS=$(wildcard *.hh *.hxx *.h)
TSC=$(wildcard *.tsc)
.PHONY: install uninstall clean
all: $(TARGET)
transport_status_code.h: gen_c.ysl2 transport_status_code.yml2 $(TSC)
yml2proc -y $< -o $@ transport_status_code.yml2
$(YML2_PROC) -y $< -o $@ transport_status_code.yml2
transport_status_code.c: gen_strings.ysl2 transport_status_code.yml2 $(TSC)
yml2proc -y $< -o $@ transport_status_code.yml2
$(YML2_PROC) -y $< -o $@ transport_status_code.yml2
PEPTransportStatusCode.h: gen_objc.ysl2 transport_status_code.yml2 $(TSC)
yml2proc -y $< -o $@ transport_status_code.yml2
$(YML2_PROC) -y $< -o $@ transport_status_code.yml2
TransportStatusCode.kt: gen_kotlin.ysl2 transport_status_code.yml2 $(TSC)
yml2proc -y $< -o $@ transport_status_code.yml2
$(YML2_PROC) -y $< -o $@ transport_status_code.yml2
install: $(TARGET)
mkdir -p $(PREFIX)/include/pEp
mkdir -p $(PREFIX)/lib
cp -v $(HEADERS) $(PREFIX)/include/pEp/
.PHONY: clean
uninstall:
cd $(PREFIX)/include/pEp && rm -vf $(HEADERS)
cd $(PREFIX)/lib && rm -vf $(TARGET)
clean:
rm -f $(TARGET)

Loading…
Cancel
Save