5 COMPILERFLAGS = -Wall -O3 -ffast-math -std=c99 -fPIC
7 INCLUDE = -I. -Ilibopenjpeg
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 \
17 INCLS = ./libopenjpeg/bio.h ./libopenjpeg/cio.h ./libopenjpeg/dwt.h \
18 ./libopenjpeg/event.h ./libopenjpeg/fix.h ./libopenjpeg/image.h \
19 ./libopenjpeg/int.h ./libopenjpeg/j2k.h ./libopenjpeg/j2k_lib.h \
20 ./libopenjpeg/jp2.h ./libopenjpeg/jpt.h ./libopenjpeg/mct.h \
21 ./libopenjpeg/mqc.h ./libopenjpeg/openjpeg.h ./libopenjpeg/pi.h \
22 ./libopenjpeg/raw.h ./libopenjpeg/t1.h ./libopenjpeg/t2.h \
23 ./libopenjpeg/tcd.h ./libopenjpeg/tgt.h ./libopenjpeg/opj_malloc.h \
24 ./libopenjpeg/opj_includes.h
26 INSTALL_LIBDIR = $(prefix)/lib
27 headerdir = openjpeg-$(MAJOR).$(MINOR)
28 INSTALL_INCLUDE = $(prefix)/include/$(headerdir)
30 # Converts cr/lf to just lf
33 ifeq ($(WITH_LCMS1),yes)
34 INCLUDE += $(LCMS1_INCLUDE)
35 LIBRARIES += $(LCMS1_LIB)
38 ifeq ($(WITH_LCMS2),yes)
39 INCLUDE += $(LCMS2_INCLUDE)
40 LIBRARIES += $(LCMS2_LIB)
43 MODULES = $(SRCS:.c=.o)
45 CFLAGS = $(COMPILERFLAGS) $(INCLUDE)
47 LIBNAME = lib$(TARGET)
48 STATICLIB = $(LIBNAME).a
50 ifeq ($(ENABLE_SHARED),yes)
51 SHAREDLIB = $(LIBNAME).so.$(MAJOR).$(MINOR).$(BUILD)
57 make -C codec -f Makefile.nix all
58 make -C mj2 -f Makefile.nix all
59 ifeq ($(WITH_JPWL),yes)
60 make -C jpwl -f Makefile.nix all
62 ifeq ($(WITH_JP3D),yes)
63 make -C jp3d -f Makefile.nix all
67 @$(DOS2UNIX) $(SRCS) $(INCLS)
69 OpenJPEG: $(STATICLIB) $(SHAREDLIB)
71 install -m 644 $(STATICLIB) bin
72 ifeq ($(ENABLE_SHARED),yes)
73 install -m 755 $(SHAREDLIB) bin
74 (cd bin && ln -sf $(SHAREDLIB) $(LIBNAME).so.$(MAJOR).$(MINOR))
75 (cd bin && ln -sf $(LIBNAME).so.$(MAJOR).$(MINOR) $(LIBNAME).so)
79 $(CC) $(CFLAGS) -c $< -o $@
81 $(STATICLIB): $(MODULES)
85 ifeq ($(ENABLE_SHARED),yes)
86 $(SHAREDLIB): $(MODULES)
87 $(CC) -s -shared -Wl,-soname,$(LIBNAME) -o $@ $(MODULES) $(LIBRARIES)
91 install -d $(DESTDIR)$(INSTALL_LIBDIR)
92 install -m 644 -o root -g root $(STATICLIB) $(DESTDIR)$(INSTALL_LIBDIR)
93 (cd $(DESTDIR)$(INSTALL_LIBDIR) && ranlib $(STATICLIB) )
94 ifeq ($(ENABLE_SHARED),yes)
95 install -m 755 -o root -g root $(SHAREDLIB) $(DESTDIR)$(INSTALL_LIBDIR)
96 (cd $(DESTDIR)$(INSTALL_LIBDIR) && \
97 ln -sf $(SHAREDLIB) $(LIBNAME).so.$(MAJOR).$(MINOR) )
98 (cd $(DESTDIR)$(INSTALL_LIBDIR) && \
99 ln -sf $(LIBNAME).so.$(MAJOR).$(MINOR) $(LIBNAME).so )
101 install -d $(DESTDIR)$(INSTALL_INCLUDE)
102 install -m 644 -o root -g root libopenjpeg/openjpeg.h \
103 $(DESTDIR)$(INSTALL_INCLUDE)
104 (cd $(DESTDIR)$(prefix)/include && \
105 ln -sf $(headerdir)/openjpeg.h openjpeg.h)
106 make -C codec -f Makefile.nix install
107 make -C mj2 -f Makefile.nix install
108 ifeq ($(WITH_JPWL),yes)
109 make -C jpwl -f Makefile.nix install
111 ifeq ($(WITH_JP3D),yes)
112 make -C jp3d -f Makefile.nix install
115 make -C doc -f Makefile.nix install
117 ifeq ($(WITH_JPWL),yes)
119 make -C jpwl -f Makefile.nix all
121 jpwl-install: jpwl-all
122 make -C jpwl -f Makefile.nix install
126 make -C jpwl -f Makefile.nix clean
129 make -C jpwl -f Makefile.nix uninstall
132 ifeq ($(WITH_JP3D),yes)
134 make -C jp3d -f Makefile.nix all
136 jp3d-install: jp3d-all
137 make -C jp3d -f Makefile.nix install
141 make -C jp3d -f Makefile.nix clean
144 make -C jp3d -f Makefile.nix uninstall
148 make -C doc -f Makefile.nix all
151 make -C doc -f Makefile.nix install
155 rm -f core u2dtmp* $(MODULES) $(STATICLIB) $(SHAREDLIB)
156 make -C codec -f Makefile.nix clean
157 make -C mj2 -f Makefile.nix clean
158 make -C doc -f Makefile.nix clean
159 ifeq ($(WITH_JPWL),yes)
160 make -C jpwl -f Makefile.nix clean
162 ifeq ($(WITH_JP3D),yes)
163 make -C jp3d -f Makefile.nix clean
167 make -C doc -f Makefile.nix clean
170 rm -f $(DESTDIR)$(INSTALL_LIBDIR)/$(STATICLIB)
171 ifeq ($(ENABLE_SHARED),yes)
172 (cd $(DESTDIR)$(INSTALL_LIBDIR) && \
173 rm -f $(LIBNAME).so $(LIBNAME).so.$(MAJOR).$(MINOR) $(SHAREDLIB) )
176 rm -f $(DESTDIR)$(prefix)/include/openjpeg.h
177 rm -rf $(DESTDIR)$(INSTALL_INCLUDE)
178 make -C codec -f Makefile.nix uninstall
179 make -C mj2 -f Makefile.nix uninstall
180 make -C doc -f Makefile.nix uninstall
181 ifeq ($(WITH_JPWL),yes)
182 make -C jpwl -f Makefile.nix uninstall
184 ifeq ($(WITH_JP3D),yes)
185 make -C jp3d -f Makefile.nix uninstall