Build: Add make target install/uninstall

makefile-conf
heck 1 year ago
parent f7a46375f4
commit c82e07c7cf
  1. 15
      Makefile.conf
  2. 22
      src/Makefile

@ -7,17 +7,12 @@
HERE:=$(dir $(lastword $(MAKEFILE_LIST)))
######### YML2 #########
# Build config
# Defaults
PREFIX?=$(HOME)
YML2_PATH=$(HOME)/yml2
YML2_PROC=$(YML2_PATH)/yml2proc $(YML2_OPTS)
YML2_OPTS=--encoding=utf8
######### Footer #########
################################
# Include local.conf for any overrides and additional flags
################################
-include $(HERE)/local.conf
# Overrides
-include $(HERE)local.conf

@ -1,15 +1,11 @@
include Makefile.conf
ifneq ($(wildcard local.conf),)
$(info ================================================)
$(info Overrides in `local.conf` are used.)
$(info ================================================)
endif
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)
@ -24,7 +20,15 @@ PEPTransportStatusCode.h: gen_objc.ysl2 transport_status_code.yml2 $(TSC)
TransportStatusCode.kt: gen_kotlin.ysl2 transport_status_code.yml2 $(TSC)
$(YML2_PROC) -y $< -o $@ transport_status_code.yml2
.PHONY: clean
install: $(TARGET)
mkdir -p $(PREFIX)/include/pEp
mkdir -p $(PREFIX)/lib
cp -v $(HEADERS) $(PREFIX)/include/pEp/
uninstall:
cd $(PREFIX)/include/pEp && rm -vf $(HEADERS)
cd $(PREFIX)/lib && rm -vf $(TARGET)
clean:
rm -f $(TARGET)

Loading…
Cancel
Save