updated autotools files to improve build and install procedures (credit to Vincent...
[openjpeg.git] / libopenjpeg / Makefile.am
1 MAINTAINERCLEANFILES = Makefile.in
2
3 includesdir = $(includedir)/openjpeg-$(MAJOR_NR).$(MINOR_NR)
4 includes_HEADERS = openjpeg.h
5
6 lib_LTLIBRARIES = libopenjpeg.la
7
8 libopenjpeg_la_CPPFLAGS = \
9 -I. \
10 -I$(top_srcdir)/libopenjpeg \
11 -I$(top_builddir)/libopenjpeg \
12 @LCMS1_CFLAGS@ \
13 @LCMS2_CFLAGS@
14 libopenjpeg_la_CFLAGS =
15 libopenjpeg_la_LIBADD = @LCMS1_LIBS@ @LCMS2_LIBS@
16 libopenjpeg_la_LDFLAGS = -no-undefined -version-info @lt_version@
17
18 libopenjpeg_la_SOURCES = \
19 bio.c \
20 cio.c \
21 dwt.c \
22 event.c \
23 image.c \
24 j2k.c \
25 j2k_lib.c \
26 jp2.c \
27 jpt.c \
28 mct.c \
29 mqc.c \
30 openjpeg.c \
31 pi.c \
32 raw.c \
33 t1.c \
34 t2.c \
35 tcd.c \
36 tgt.c \
37 bio.h \
38 cio.h \
39 dwt.h \
40 event.h \
41 fix.h \
42 image.h \
43 int.h \
44 j2k.h \
45 j2k_lib.h \
46 jp2.h \
47 jpt.h \
48 mct.h \
49 mqc.h \
50 pi.h \
51 raw.h \
52 t1.h \
53 t1_luts.h \
54 t2.h \
55 tcd.h \
56 tgt.h \
57 opj_malloc.h \
58 opj_includes.h
59
60 EXTRA_DIST = \
61 CMakeLists.txt
62
63 install-data-hook:
64         cd $(DESTDIR)$(includedir) && \
65           rm -f openjpeg.h && \
66           $(LN_S) openjpeg-$(MAJOR_NR).$(MINOR_NR)/openjpeg.h \
67                   openjpeg.h
68         @rm -rf $(top_builddir)/report.txt
69         @echo -e " (LA)\t$(libdir)/libopenjpeg.la" >> $(top_builddir)/report.txt
70         @( $(call solist) ) >> $(top_builddir)/report.txt
71         @echo -e " (A)\t\t$(base)/$(a)" >> $(top_builddir)/report.txt
72         @echo -e " (H)\t\t$(includedir)/openjpeg-$(MAJOR_NR).$(MINOR_NR)/openjpeg.h" >> $(top_builddir)/report.txt
73         @echo -e " (LN)\t$(includedir)/openjpeg.h" >> $(top_builddir)/report.txt
74
75 uninstall-hook:
76         rm -f $(DESTDIR)$(includedir)/openjpeg.h
77
78 solist    = $(foreach f, $(dll) $(so), echo -e ' $(SO_PREFIX)\t$(base)/$(f)' ;)
79 get_tok   = $(shell grep -E "^$(1)=" $(lib_LTLIBRARIES) | cut -d "'" -f 2)
80 base      = $(call get_tok,libdir)
81 so        = $(call get_tok,library_names)
82 a         = $(call get_tok,old_library)
83
84 if HAVE_WIN32
85 SO_PREFIX = (DLL)
86 dll       = $(call get_tok,dlname)
87 else
88 if HAVE_DARWIN
89 SO_PREFIX = (DY)
90 dll       =
91 else
92 SO_PREFIX = (SO)
93 dll       =
94 endif
95 endif