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 MODULES = $(SRCS:.c=.o)
35 CFLAGS = $(COMPILERFLAGS) $(INCLUDE)
37 LIBNAME = lib$(TARGET)
38 STATICLIB = $(LIBNAME).a
40 ifeq ($(ENABLE_SHARED),yes)
41 SHAREDLIB = $(LIBNAME).so.$(MAJOR).$(MINOR).$(BUILD)
47 make -C codec -f Makefile.nix all
48 make -C mj2 -f Makefile.nix all
49 ifeq ($(WITH_JPWL),yes)
50 make -C jpwl -f Makefile.nix all
52 ifeq ($(WITH_JP3D),yes)
53 make -C jp3d -f Makefile.nix all
57 @$(DOS2UNIX) $(SRCS) $(INCLS)
59 OpenJPEG: $(STATICLIB) $(SHAREDLIB)
61 install -m 644 $(STATICLIB) bin
62 ifeq ($(ENABLE_SHARED),yes)
63 install -m 755 $(SHAREDLIB) bin
64 (cd bin && ln -sf $(SHAREDLIB) $(LIBNAME).so.$(MAJOR).$(MINOR))
65 (cd bin && ln -sf $(LIBNAME).so.$(MAJOR).$(MINOR) $(LIBNAME).so)
69 $(CC) $(CFLAGS) -c $< -o $@
71 $(STATICLIB): $(MODULES)
75 ifeq ($(ENABLE_SHARED),yes)
76 $(SHAREDLIB): $(MODULES)
77 $(CC) -shared -Wl,-soname,$(LIBNAME) -o $@ $(MODULES) $(LIBRARIES)
81 install -d $(DESTDIR)$(INSTALL_LIBDIR)
82 install -m 644 -o root -g root $(STATICLIB) $(DESTDIR)$(INSTALL_LIBDIR)
83 (cd $(DESTDIR)$(INSTALL_LIBDIR) && ranlib $(STATICLIB) )
84 ifeq ($(ENABLE_SHARED),yes)
85 install -m 755 -o root -g root $(SHAREDLIB) $(DESTDIR)$(INSTALL_LIBDIR)
86 (cd $(DESTDIR)$(INSTALL_LIBDIR) && \
87 ln -sf $(SHAREDLIB) $(LIBNAME).so.$(MAJOR).$(MINOR) )
88 (cd $(DESTDIR)$(INSTALL_LIBDIR) && \
89 ln -sf $(LIBNAME).so.$(MAJOR).$(MINOR) $(LIBNAME).so )
91 install -d $(DESTDIR)$(INSTALL_INCLUDE)
92 install -m 644 -o root -g root libopenjpeg/openjpeg.h \
93 $(DESTDIR)$(INSTALL_INCLUDE)
94 (cd $(DESTDIR)$(prefix)/include && \
95 ln -sf $(headerdir)/openjpeg.h openjpeg.h)
96 make -C codec -f Makefile.nix install
97 make -C mj2 -f Makefile.nix install
98 ifeq ($(WITH_JPWL),yes)
99 make -C jpwl -f Makefile.nix install
101 ifeq ($(WITH_JP3D),yes)
102 make -C jp3d -f Makefile.nix install
105 make -C doc -f Makefile.nix install
107 ifeq ($(WITH_JPWL),yes)
109 make -C jpwl -f Makefile.nix all
111 jpwl-install: jpwl-all
112 make -C jpwl -f Makefile.nix install
116 make -C jpwl -f Makefile.nix clean
119 make -C jpwl -f Makefile.nix uninstall
122 ifeq ($(WITH_JP3D),yes)
124 make -C jp3d -f Makefile.nix all
126 jp3d-install: jp3d-all
127 make -C jp3d -f Makefile.nix install
131 make -C jp3d -f Makefile.nix clean
134 make -C jp3d -f Makefile.nix uninstall
138 make -C doc -f Makefile.nix all
141 make -C doc -f Makefile.nix install
145 rm -f core u2dtmp* $(MODULES) $(STATICLIB) $(SHAREDLIB)
146 make -C codec -f Makefile.nix clean
147 make -C mj2 -f Makefile.nix clean
148 make -C doc -f Makefile.nix clean
149 ifeq ($(WITH_JPWL),yes)
150 make -C jpwl -f Makefile.nix clean
152 ifeq ($(WITH_JP3D),yes)
153 make -C jp3d -f Makefile.nix clean
157 make -C doc -f Makefile.nix clean
160 rm -f $(DESTDIR)$(INSTALL_LIBDIR)/$(STATICLIB)
161 ifeq ($(ENABLE_SHARED),yes)
162 (cd $(DESTDIR)$(INSTALL_LIBDIR) && \
163 rm -f $(LIBNAME).so $(LIBNAME).so.$(MAJOR).$(MINOR) $(SHAREDLIB) )
166 rm -f $(DESTDIR)$(prefix)/include/openjpeg.h
167 rm -rf $(DESTDIR)$(INSTALL_INCLUDE)
168 make -C codec -f Makefile.nix uninstall
169 make -C mj2 -f Makefile.nix uninstall
170 make -C doc -f Makefile.nix uninstall
171 ifeq ($(WITH_JPWL),yes)
172 make -C jpwl -f Makefile.nix uninstall
174 ifeq ($(WITH_JP3D),yes)
175 make -C jp3d -f Makefile.nix uninstall