157f2806cb6b9a0bb5e1eaad43b29c48cfb3c73a
[openjpeg.git] / libopenjpeg / Makefile.am
1 MAJOR = @MAJOR_NR@
2 MINOR = @MINOR_NR@
3 BUILD = @BUILD_NR@
4 CURRENT=`expr $(MAJOR) + $(MINOR)`
5
6 lib_LTLIBRARIES = libopenjpeg.la
7
8 INCLUDES = -I.. -I.
9
10 libopenjpeg_la_LDFLAGS = -no-undefined \
11   -version-info $(CURRENT):$(BUILD):$(MINOR)
12
13 libopenjpeg_la_LIBADD = @LDLIBS@ 
14
15 SRCS = bio.c cio.c dwt.c event.c image.c j2k.c j2k_lib.c jp2.c jpt.c \
16  mct.c mqc.c openjpeg.c pi.c raw.c t1.c t2.c tcd.c tgt.c
17
18 INCLS = bio.h cio.h dwt.h event.h fix.h image.h int.h j2k.h j2k_lib.h \
19  jp2.h jpt.h mct.h mqc.h pi.h raw.h t1.h t2.h tcd.h tgt.h opj_malloc.h \
20  opj_includes.h
21
22 libopenjpeg_la_SOURCES = $(SRCS) $(INCLS)
23
24 includedir = ${prefix}/include/openjpeg-$(MAJOR).$(MINOR)
25 include_HEADERS = openjpeg.h
26
27 # Converts cr/lf to just lf
28 DOS2UNIX = dos2unix
29
30 dos2unix:
31         @$(DOS2UNIX) $(SRCS) $(INCLS)
32
33 COMPILERFLAGS = -Wall -O3 -ffast-math -std=c99
34
35 if with_liblcms1
36 INCLUDES += @lcms1includes@
37 endif
38
39 if with_liblcms2
40 INCLUDES += @lcms2includes@
41 endif
42
43 CFLAGS = $(COMPILERFLAGS) $(INCLUDES)
44
45 headerdir = openjpeg-$(MAJOR).$(MINOR)
46
47 all-local:
48         @$(INSTALL) -d ../bin
49         @cp -P .libs/libopenjpeg.* ../bin/
50         @rm -f ../bin/libopenjpeg.la*
51         @rm -rf .report_lib
52         @$(INSTALL) -d .report_lib
53         @cp -P .libs/libopenjpeg.* .report_lib
54         @rm -f .report_lib/libopenjpeg.lai
55         @echo "" > .report.txt
56         @echo "Installing: ${prefix}/include/${headerdir}/" >> .report.txt
57         @echo "Installing: ${prefix}/include/${headerdir}/openjpeg.h" >> .report.txt
58         @(cd .report_lib; \
59         l=`ls --file-type`; \
60         for f in $$l ; do \
61         echo "Installing: ${prefix}/lib/$$f" >> ../.report.txt ; \
62         done)
63         @rm -rf .report_lib
64
65 install-data-hook:
66         (cd $(DESTDIR)${prefix}/include && rm -f openjpeg.h)
67         (cd $(DESTDIR)${prefix}/include && \
68         $(LN_S) ${headerdir}/openjpeg.h openjpeg.h)
69         
70 uninstall-hook:
71         (cd $(DESTDIR)${prefix}/include && rm -rf openjpeg.h ${headerdir})