Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4758 | right-hear | 1 | #jpwl Makefile |
2 | include ../config.nix |
||
3 | |||
4 | TARGET = openjpeg_JPWL |
||
5 | COMPILERFLAGS = -Wall -ffast-math -std=c99 -fPIC |
||
6 | USERLIBS = |
||
7 | |||
8 | JPWL_SRCS = ./crc.c ./jpwl.c ./jpwl_lib.c ./rs.c |
||
9 | |||
10 | SRCS = ../libopenjpeg/bio.c ../libopenjpeg/cio.c ../libopenjpeg/dwt.c \ |
||
11 | ../libopenjpeg/event.c ../libopenjpeg/image.c ../libopenjpeg/j2k.c \ |
||
12 | ../libopenjpeg/j2k_lib.c ../libopenjpeg/jp2.c ../libopenjpeg/jpt.c \ |
||
13 | ../libopenjpeg/mct.c ../libopenjpeg/mqc.c ../libopenjpeg/openjpeg.c \ |
||
14 | ../libopenjpeg/pi.c ../libopenjpeg/raw.c ../libopenjpeg/t1.c \ |
||
15 | ../libopenjpeg/t2.c ../libopenjpeg/tcd.c ../libopenjpeg/tgt.c \ |
||
16 | $(JPWL_SRCS) |
||
17 | |||
18 | INCLS = ../libopenjpeg/bio.h ../libopenjpeg/cio.h ../libopenjpeg/dwt.h \ |
||
19 | ../libopenjpeg/event.h ../libopenjpeg/fix.h ../libopenjpeg/image.h \ |
||
20 | ../libopenjpeg/int.h ../libopenjpeg/j2k.h ../libopenjpeg/j2k_lib.h \ |
||
21 | ../libopenjpeg/jp2.h ../libopenjpeg/jpt.h ../libopenjpeg/mct.h \ |
||
22 | ../libopenjpeg/mqc.h ../libopenjpeg/openjpeg.h ../libopenjpeg/pi.h \ |
||
23 | ../libopenjpeg/raw.h ../libopenjpeg/t1.h ../libopenjpeg/t2.h \ |
||
24 | ../libopenjpeg/tcd.h ../libopenjpeg/tgt.h ../libopenjpeg/opj_malloc.h \ |
||
25 | ../libopenjpeg/opj_includes.h |
||
26 | |||
27 | INCLUDE = -I.. -I. -I../libopenjpeg -I../common |
||
28 | |||
29 | INSTALL_LIBDIR = $(prefix)/lib |
||
30 | INSTALL_BIN = $(prefix)/bin |
||
31 | |||
32 | # Converts cr/lf to just lf |
||
33 | DOS2UNIX = dos2unix |
||
34 | |||
35 | |||
36 | LIBRARIES = -lstdc++ |
||
37 | |||
38 | ifeq ($(WITH_TIFF),yes) |
||
39 | INCLUDE += $(TIFF_INCLUDE) |
||
40 | USERLIBS += $(TIFF_LIB) |
||
41 | endif |
||
42 | |||
43 | ifeq ($(WITH_PNG),yes) |
||
44 | INCLUDE += $(PNG_INCLUDE) |
||
45 | USERLIBS += $(PNG_LIB) |
||
46 | endif |
||
47 | |||
48 | ifeq ($(WITH_LCMS2),yes) |
||
49 | INCLUDE += $(LCMS2_INCLUDE) |
||
50 | USERLIBS += $(LCMS2_LIB) |
||
51 | endif |
||
52 | |||
53 | ifeq ($(WITH_LCMS1),yes) |
||
54 | INCLUDE += $(LCMS1_INCLUDE) |
||
55 | USERLIBS += $(LCMS1_LIB) |
||
56 | endif |
||
57 | |||
58 | USERLIBS += -lm |
||
59 | |||
60 | MODULES = $(SRCS:.c=.o) |
||
61 | |||
62 | CFLAGS = $(COMPILERFLAGS) $(INCLUDE) -DUSE_JPWL |
||
63 | |||
64 | LIBNAME = lib$(TARGET) |
||
65 | |||
66 | ifeq ($(ENABLE_SHARED),yes) |
||
67 | SHAREDLIB = $(LIBNAME).so.$(MAJOR).$(MINOR).$(BUILD) |
||
68 | else |
||
69 | STATICLIB = $(LIBNAME).a |
||
70 | endif |
||
71 | |||
72 | default: all |
||
73 | |||
74 | all: OpenJPEG_JPWL JPWL_image_to_j2k JPWL_j2k_to_image |
||
75 | install -d ../bin |
||
76 | ifeq ($(ENABLE_SHARED),yes) |
||
77 | install -m 755 $(SHAREDLIB) ../bin |
||
78 | (cd ../bin && ln -sf $(SHAREDLIB) $(LIBNAME).so.$(MAJOR).$(MINOR)) |
||
79 | (cd ../bin && ln -sf $(LIBNAME).so.$(MAJOR).$(MINOR) $(LIBNAME).so) |
||
80 | else |
||
81 | install -m 644 $(STATICLIB) ../bin |
||
82 | endif |
||
83 | install JPWL_image_to_j2k JPWL_j2k_to_image ../bin |
||
84 | |||
85 | dos2unix: |
||
86 | @$(DOS2UNIX) $(SRCS) $(INCLS) |
||
87 | |||
88 | OpenJPEG_JPWL: $(STATICLIB) $(SHAREDLIB) |
||
89 | |||
90 | JPWL_codec: JPWL_j2k_to_image JPWL_image_to_j2k $(STATICLIB) |
||
91 | |||
92 | .c.o: |
||
93 | $(CC) $(CFLAGS) -c $< -o $@ |
||
94 | |||
95 | ifeq ($(ENABLE_SHARED),yes) |
||
96 | $(SHAREDLIB): $(MODULES) |
||
97 | $(CC) -shared -Wl,-soname,$(LIBNAME) -o $@ $(MODULES) $(LIBRARIES) |
||
98 | else |
||
99 | $(STATICLIB): $(MODULES) |
||
100 | $(AR) r $@ $(MODULES) |
||
101 | endif |
||
102 | |||
103 | ifeq ($(ENABLE_SHARED),yes) |
||
104 | ELIB = $(SHAREDLIB) |
||
105 | else |
||
106 | ELIB = $(STATICLIB) |
||
107 | endif |
||
108 | |||
109 | JPWL_j2k_to_image: ../codec/j2k_to_image.c |
||
110 | $(CC) $(CFLAGS) ../common/getopt.c ../codec/index.c \ |
||
111 | ../codec/convert.c ../common/color.c ../codec/j2k_to_image.c \ |
||
112 | -o JPWL_j2k_to_image $(ELIB) $(USERLIBS) |
||
113 | |||
114 | JPWL_image_to_j2k: ../codec/image_to_j2k.c |
||
115 | $(CC) $(CFLAGS) ../common/getopt.c ../codec/index.c \ |
||
116 | ../codec/convert.c ../codec/image_to_j2k.c \ |
||
117 | -o JPWL_image_to_j2k $(ELIB) $(USERLIBS) |
||
118 | |||
119 | install: OpenJPEG_JPWL |
||
120 | install -d $(DESTDIR)$(INSTALL_LIBDIR) |
||
121 | ifeq ($(ENABLE_SHARED),yes) |
||
122 | install -m 755 -o root -g root $(SHAREDLIB) $(DESTDIR)$(INSTALL_LIBDIR) |
||
123 | (cd $(DESTDIR)$(INSTALL_LIBDIR) && \ |
||
124 | ln -sf $(SHAREDLIB) $(LIBNAME).so.$(MAJOR).$(MINOR) ) |
||
125 | (cd $(DESTDIR)$(INSTALL_LIBDIR) && \ |
||
126 | ln -sf $(LIBNAME).so.$(MAJOR).$(MINOR) $(LIBNAME).so ) |
||
127 | else |
||
128 | install -m 644 -o root -g root $(STATICLIB) $(DESTDIR)$(INSTALL_LIBDIR) |
||
129 | (cd $(DESTDIR)$(INSTALL_LIBDIR) && ranlib $(STATICLIB)) |
||
130 | endif |
||
131 | install -d $(DESTDIR)$(INSTALL_BIN) |
||
132 | install -m 755 -o root -g root JPWL_j2k_to_image $(DESTDIR)$(INSTALL_BIN) |
||
133 | install -m 755 -o root -g root JPWL_image_to_j2k $(DESTDIR)$(INSTALL_BIN) |
||
134 | |||
135 | cleanlib: |
||
136 | rm -f core u2dtmp* $(MODULES) $(STATICLIB) $(SHAREDLIB) |
||
137 | |||
138 | cleancodec: |
||
139 | rm -f JPWL_j2k_to_image JPWL_image_to_j2k JPWL_j2k_to_image.o \ |
||
140 | JPWL_image_to_j2k.o |
||
141 | |||
142 | clean: cleanlib cleancodec |
||
143 | |||
144 | uninstall: |
||
145 | ifeq ($(ENABLE_SHARED),yes) |
||
146 | (cd $(DESTDIR)$(INSTALL_LIBDIR) && \ |
||
147 | rm -f $(LIBNAME).so $(LIBNAME).so.$(MAJOR).$(MINOR) $(SHAREDLIB)) |
||
148 | else |
||
149 | rm -f $(DESTDIR)$(INSTALL_LIBDIR)/$(STATICLIB) |
||
150 | endif |
||
151 | rm -f $(DESTDIR)$(INSTALL_BIN)/JPWL_j2k_to_image |
||
152 | rm -f $(DESTDIR)$(INSTALL_BIN)/JPWL_image_to_j2k> |