1# @(#) $Id: Makefile,v 1.33 2005/07/25 19:41:06 alex Exp $
2# Makefile for EXIFPROBE image file probe
3
4# Any compiler should do
5CC=cc
6CFLAGS=-pipe -O2 -fno-strict-aliasing  -DCOLOR -O
7
8# You probably don't need these
9# CFLAGS=-pipe -O2 -fno-strict-aliasing  -DCOLOR -g -O -Dlint -Wall  -Wno-long-long
10# SPLINTCFLAGS=-pipe -O2 -fno-strict-aliasing  -DCOLOR -Dlint -showsummary
11
12# If your system has strcasestr(3) you can use this if you like.
13# If not defined a fake routine is used (which should be good enough,
14# this is used only for the -C option)
15# CFLAGS+=-DSTRCASESTR=strcasestr
16
17#Solaris; cultural differences
18#CFLAGS += -Du_int32_t=uint32_t
19
20# You'll need this on big-endian machines if (and ONLY if) "byteorder.h"
21# is not created properly on first invocation.
22#CFLAGS += -DNATIVE_BYTEORDER_BIGENDIAN     # or add to ./byteorder.h
23
24# On Solaris, you may need to use 'gmake', or edit the next line.
25PREFIX ?= /usr/local
26BINDIR=$(PREFIX)/bin
27MANDIR=$(PREFIX)/man/man1
28
29
30INCLUDES=defs.h extern.h misc.h tifftags.h exiftags.h \
31	tiffeptags.h jpegtags.h global.h
32
33MAKERSRCS=maker_nikon.c maker_epson.c maker_olympus.c maker_fujifilm.c \
34	maker_casio.c maker_minolta.c maker_sanyo.c maker_canon.c \
35    maker_leica.c maker_agfa.c maker_asahi.c maker_panasonic.c \
36    maker_kyocera.c maker_toshiba.c maker_sigma.c maker_sony.c \
37    maker_konica.c maker_hp.c maker_kodak.c maker_ricoh.c \
38    maker_traveler.c
39
40MAKEROBJS=maker_nikon.o maker_epson.o maker_olympus.o maker_fujifilm.o \
41	maker_casio.o maker_minolta.o maker_sanyo.o maker_canon.o \
42    maker_leica.o maker_agfa.o maker_asahi.o maker_panasonic.o \
43    maker_kyocera.o maker_toshiba.o maker_sigma.o maker_sony.o \
44    maker_konica.o maker_hp.o maker_kodak.o maker_ricoh.o \
45    maker_traveler.o
46
47SRCS=main.c readfile.c print.c tagnames.c process.c misc.c interpret.c \
48	print_maker.c maker_generic.c maker_tagnames.c options.c ciff.c\
49    jp2000.c mrw.c raf.c x3f.c \
50	$(MAKERSRCS)
51
52OBJS=main.o readfile.o print.o tagnames.o process.o misc.o interpret.o \
53	print_maker.o maker_generic.o maker_tagnames.o options.o ciff.o \
54    jp2000.o mrw.o veclib.o raf.o x3f.o \
55	$(MAKEROBJS)
56
57all: byteorder.h exifprobe
58
59byteorder.h:
60	@echo -n "Creating byteorder.h: "
61	@sh makebyteorder.sh
62	@cat byteorder.h
63	@echo
64
65veclib.o: lib/veclib.c
66	$(CC) -o veclib.o -c $(CFLAGS) lib/veclib.c
67
68# Need the math library to calculate some APEX things...
69exifprobe: $(OBJS) $(INCLUDES) Makefile
70	./mkcomptime > comptime.c
71	$(CC) -o exifprobe $(CFLAGS) $(OBJS) comptime.c -lm
72
73install: all
74	cp exifprobe $(BINDIR)
75	cp exifgrep $(BINDIR)
76	cp exifprobe.1 $(MANDIR)
77	cp exifgrep.1 $(MANDIR)
78
79# if you want HTML man pages, pick a target; I prefer man2html
80rman: exifprobe.1 exifgrep.1
81    # edit at <blockquote> & APP0...APPn; rman gets it wrong
82	rman -f HTML exifprobe.1 > exifprobe-rman.html
83	rman -f HTML exifgrep.1 > exifgrep-rman.html
84
85man: exifprobe.1 exifgrep.1
86	groff -man -Thtml exifprobe.1 > exifprobe-man.html
87	groff -man -Thtml exifgrep.1 > exifgrep-man.html
88
89man2html:
90	nroff -man exifprobe.1 | man2html -pgsize 1024 -topm 0 -botm 2 -noheads > exifprobe.1.html
91	nroff -man exifgrep.1 | man2html -pgsize 1024 -topm 0 -botm 2 -noheads > exifgrep.1.html
92
93clean:
94	rm -f exifprobe *.o comptime.c
95
96distclean: clean undepend
97	rm -f byteorder.h MANIFEST.* Makefile.bak exifprobe-*.tar.gz
98
99depend: byteorder.h
100	makedepend -- $(CFLAGS) -- $(SRCS)
101
102undepend:
103	makedepend
104
105splint: $(SRCS) $(INCLUDES) Makefile
106	splint $(SPLINTCFLAGS) $(SRCS)
107
108# DO NOT DELETE THIS LINE -- make depend depends on it.
109