remove (autotools) generated files
[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 SRCS = bio.c cio.c dwt.c event.c image.c j2k.c j2k_lib.c jp2.c jpt.c \
14  mct.c mqc.c openjpeg.c pi.c raw.c t1.c t2.c tcd.c tgt.c
15
16 INCLS = bio.h cio.h dwt.h event.h fix.h image.h int.h j2k.h j2k_lib.h \
17  jp2.h jpt.h mct.h mqc.h pi.h raw.h t1.h t2.h tcd.h tgt.h opj_malloc.h \
18  opj_includes.h
19
20 libopenjpeg_la_SOURCES = $(SRCS) $(INCLS)
21
22 includedir = ${prefix}/include/openjpeg-$(MAJOR).$(MINOR)
23 include_HEADERS = openjpeg.h
24
25 # Converts cr/lf to just lf
26 DOS2UNIX = dos2unix
27
28 dos2unix:
29         @$(DOS2UNIX) $(SRCS) $(INCLS)
30
31 COMPILERFLAGS = -Wall -O3 -ffast-math -std=c99
32
33 if with_sharedlibs
34 COMPILERFLAGS += -DOPJ_EXPORTS
35 else
36 COMPILERFLAGS += -DOPJ_STATIC
37 libopenjpeg_la_LDFLAGS += -static
38 endif
39
40 CFLAGS = $(COMPILERFLAGS) $(INCLUDES)
41
42 headerdir = openjpeg-$(MAJOR).$(MINOR)
43
44 all-local:
45         @$(INSTALL) -d ../bin
46         @rm -rf .report_dir
47         @$(INSTALL) -d .report_dir
48 if build_so
49 if with_sharedlibs
50         @find .libs -type f -name "*\.so*" -exec cp -P {} .report_dir \;
51         @find .libs -type l -name "*\.so*" -exec cp -P {} .report_dir \;
52 else !with_sharedlibs
53         @find .libs -type f -name "*\.a" -exec cp -P {} .report_dir \;
54 endif !with_sharedlibs
55 endif
56 if build_dll
57 if with_sharedlibs
58         @find .libs -type f -name "*\.dll" -exec cp -P {} .report_dir \;
59         @find .libs -type f -name "*\.a" -exec cp -P {} .report_dir \;
60 else !with_sharedlibs
61         @find .libs -type f -name "*\.a" -exec cp -P {} .report_dir \;
62 endif !with_sharedlibs
63 endif
64 if build_dylib
65 if with_sharedlibs
66         @find .libs -type f -name "*\.dylib" -exec cp -P {} .report_dir \;
67 else !with_sharedlibs
68         @find .libs -type l -name "*\.a" -exec cp -P {} .report_dir \;
69 endif !with_sharedlibs
70 endif
71         @cp -a .report_dir/* ../bin
72         @echo "" > .report.txt
73         @echo "Installing: ${prefix}/include/${headerdir}/" >> .report.txt
74         @echo "Installing: ${prefix}/include/${headerdir}/openjpeg.h" >> .report.txt
75         @echo "Installing: ${prefix}/lib/libopenjpeg.la" >> .report.txt
76         @(cd .report_dir; \
77         for file in `ls *.dll 2> /dev/null` ; do \
78         echo "Installing: ${prefix}/bin/$${file}" >> ../.report.txt ; \
79         done ; \
80         for file in `ls *.a 2> /dev/null` ; do \
81         echo "Installing: ${prefix}/lib/$${file}" >> ../.report.txt ; \
82         done ; \
83         for file in `ls *.so* 2> /dev/null` ; do \
84         echo "Installing: ${prefix}/lib/$${file}" >> ../.report.txt ; \
85         done ; \
86         for file in `ls *.dylib 2> /dev/null` ; do \
87         echo "Installing: ${prefix}/lib/$${file}" >> ../.report.txt ; \
88         done \
89         )
90         @rm -rf .report_dir
91
92 install-data-hook:
93         (cd $(DESTDIR)${prefix}/include && rm -f openjpeg.h)
94         (cd $(DESTDIR)${prefix}/include && \
95         $(LN_S) ${headerdir}/openjpeg.h openjpeg.h)
96         
97 uninstall-hook:
98         (cd $(DESTDIR)${prefix}/include && rm -rf openjpeg.h ${headerdir})