-
Notifications
You must be signed in to change notification settings - Fork 29
/
makefile
46 lines (36 loc) · 1.06 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
#--------------------------------
# jhead makefile for Unix
#--------------------------------
PREFIX=$(DESTDIR)/usr/local
BINDIR=$(PREFIX)/bin
DOCDIR=$(PREFIX)/share/doc/jhead
MANDIR=$(PREFIX)/share/man/man1
OBJ=obj
SRC=.
DPKG_BUILDFLAGS := $(shell command -v dpkg-buildflags 2> /dev/null)
ifdef DPKG_BUILDFLAGS
CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
endif
# To enable electric fence, set ELECTRIC_FENCE=1
ifeq ($(ELECTRIC_FENCE),1)
CFLAGS += -fsanitize=address
LDFLAGS += -fsanitize=address
endif
all: objdir jhead
docs = $(SRC)/usage.html
objdir:
@mkdir -p obj
objs = $(OBJ)/jhead.o $(OBJ)/jpgfile.o $(OBJ)/jpgqguess.o $(OBJ)/paths.o \
$(OBJ)/exif.o $(OBJ)/iptc.o $(OBJ)/gpsinfo.o $(OBJ)/makernote.o
$(OBJ)/%.o:$(SRC)/%.c objdir
${CC} $(CFLAGS) $(CPPFLAGS) -c $< -o $@
jhead: $(objs) jhead.h
${CC} $(LDFLAGS) -o jhead $(objs) -lm
clean:
rm -f $(objs) jhead
install: all
install -d $(BINDIR) $(DOCDIR) $(MANDIR)
install -m 0755 jhead $(BINDIR)
install -m 0644 $(docs) $(DOCDIR)
install -m 0644 jhead.1 $(MANDIR)