-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
72 lines (48 loc) · 1.53 KB
/
Makefile
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Makefile for tiff2png
# Copyright 1996 Willem van Schaik
# Copyright 2002 Greg Roelofs
# Copyright 2014 Ralph Giles
PACKAGE := tiff2png
VERSION := 0.92
CC ?= gcc
CFLAGS ?= -g -Wall -O3
PREFIX ?= /usr/local
# It appears that PHOTOMETRIC_MINISWHITE should always be inverted (which
# makes sense), but if you find a class of TIFFs or a version of libtiff for
# which that is *not* the case, try not defining INVERT_MINISWHITE.
CFLAGS += -DINVERT_MINISWHITE
# DESTDIR_IS_CURDIR will put all converted images into the current directory
# by default or if the -destdir option is given without an argument.
CFLAGS += -DDESTDIR_IS_CURDIR
GIT_VERSION := $(shell git describe --always --tags --match 'v*' --dirty)
VERSION := $(or $(patsubst v%,%,$(GIT_VERSION)),$(VERSION),unknown)
CFLAGS += -DVERSION=\"$(VERSION)\"
all: tiff2png
SRCS := tiff2png.c
LIBS := -ltiff -ljpeg -lpng -lz -lm
EXTRA_DIST := README CHANGES Makefile.w32
OBJS := $(SRCS:%.c=%.o)
tiff2png: tiff2png.o
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
check: all
./tiff2png -h
clean:
$(RM) $(OBJS) tiff2png
BINDIR := $(PREFIX)/bin
install: all
mkdir -p $(BINDIR)
cp tiff2png $(BINDIR)/
DISTDIR := $(PACKAGE)-$(VERSION)
dist: $(DISTDIR).tar.gz
$(DISTDIR).tar.gz: Makefile $(SRCS) $(EXTRA_DIST)
-$(RM) -r $(DISTDIR)
mkdir $(DISTDIR)
cp $^ $(DISTDIR)/
tar czf $@ $(DISTDIR)/*
$(RM) -r $(DISTDIR)
distcheck: dist
tar xf $(DISTDIR).tar.gz
cd $(DISTDIR) && make check && make dist
$(RM) -r $(DISTDIR)
@echo $(DISTDIR).tar.gz is ready to distribute
.PHONY: all clean install dist distcheck