]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blob - common.mk
Fix warnings when building demo app
[pes-rpp/rpp-lib.git] / common.mk
1 # Common GNU Make definitions useful for multiple Makefiles
2
3 ECLIPSE=$(foreach file,\
4                   /opt/ti/ccsv5/eclipse/eclipse \
5                   C:/ti/ccsv5/eclipse/eclipsec.exe,\
6             $(if $(wildcard $(file)),$(file)))
7
8 ifeq ($(OS),Windows_NT)
9 TMP_WORKSPACE=$(TEMP)/_workspace
10 else
11 TMP_WORKSPACE:=$(shell mktemp --dry-run --tmpdir -d rpp-test-sw-workspace.XXXXXXXXXX)
12 endif
13
14
15 ifeq ($(OS),Windows_NT)
16 pathconv=$(subst /,\,$1)
17 mkdir=-mkdir $(subst /,\,$1)
18 rm=-del /Q $(call pathconv,$1)
19 rmdir=-rmdir /S /Q $(call pathconv,$1)
20 cp=copy $(subst /,\,$1) $(subst /,\,$2)
21 else
22 pathconv=$1
23 mkdir=mkdir -p $1
24 rm=rm -rf $1
25 rmdir=-rm -rf $1
26 cp=cp $1 $2
27 endif
28
29 RELEASE_COMMIT = HEAD
30 RELEASE_PREFIX ?= prefix
31 ifneq ($(OS),Windows_NT)
32 RELEASE_VERSION := $(shell git describe --always $(RELEASE_COMMIT)|sed -e "s/^[-a-zA-Z_]*//")
33 endif
34 RELEASE_BASENAME = $(RELEASE_PREFIX)-$(RELEASE_VERSION)
35
36 .PHONY: $(RELEASE_BASENAME).zip
37
38 $(RELEASE_BASENAME).zip:
39         rm -rf $@ $(RELEASE_BASENAME)
40         $(MAKE) $(RELEASE_BASENAME)
41         zip  -r $@ $(RELEASE_BASENAME)
42
43 $(RELEASE_BASENAME)::
44         git archive --worktree-attributes --prefix=$@/ $(RELEASE_COMMIT) | tar xf -