File: Makefile

package info (click to toggle)
jshon 20131010-3
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, jessie, jessie-kfreebsd, stretch
  • size: 180 kB
  • ctags: 152
  • sloc: ansic: 1,706; makefile: 54
file content (39 lines) | stat: -rw-r--r-- 967 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# jshon - command line JSON parsing

CFLAGS := -std=c99 -Wall -pedantic -Wextra ${CFLAGS}
LDLIBS  = -ljansson
INSTALL=install
DESTDIR?=/
MANDIR=$(DESTDIR)/usr/share/man/man1/
TARGET_PATH=$(DESTDIR)/usr/bin
DISTFILES=jshon
MANFILE=jshon.1

#VERSION=$(shell date +%Y%m%d)
VERSION=$(shell git show -s --format="%ci" HEAD | cut -d ' ' -f 1 | tr -d '-')
#VERSION=$(grep "^#define JSHONVER" | cut -d ' ' -f 3)

all: $(DISTFILES)

$(DISTFILES): jshon.o

strip: $(DISFILES)
	strip --strip-all $(DISTFILES)

clean:
	rm -f *.o $(DISTFILES)

install:
	$(INSTALL) -D $(DISTFILES) $(TARGET_PATH)/$(DISTFILES)
	$(INSTALL) -D $(MANFILE) $(MANDIR)/$(MANFILE)

dist: clean
	sed -i "s/#define JSHONVER .*/#define JSHONVER ${VERSION}/" jshon.c
	sed -i "s/Version:.*"/Version:\t${VERSION}" jshon.spec
	mkdir jshon-${VERSION}
	cp jshon.c jshon.1 Makefile LICENSE jshon-${VERSION}
	tar czf jshon-${VERSION}.tar.gz jshon-${VERSION}
	${RM} -r jshon-${VERSION}

.PHONY: all clean dist strip