6 PKG_CONFIG ?
= pkg-config
11 BINDIR ?
= $(PREFIX
)/bin
12 SHAREDIR ?
= $(PREFIX
)/share
13 MANDIR ?
= $(SHAREDIR
)/man
14 LIBDIR ?
= $(PREFIX
)/lib
15 INCDIR ?
= $(PREFIX
)/include
17 CXXFLAGS
+= -std
=c
++14
25 CXXFLAGS
+= $(shell $(PKG_CONFIG
) --cflags libjpeg libpng gl glut zlib
)
26 LDFLAGS
+= $(shell $(PKG_CONFIG
) --libs libjpeg libpng gl glut zlib
)
36 $(CXX
) $(CXXFLAGS
) -fPIC
-c
-o
$@
$<
39 $(CXX
) $(CXXFLAGS
) -Isrc
-c
-o
$@
$<
41 sjpeg
: sharedlib sjpeg.o utils.o
42 $(CXX
) $(CXXFLAGS
) -o
$@ sjpeg.o utils.o
$(LDFLAGS
) -L.
-Wl
,--as-needed
-lsjpeg
44 vjpeg
: sharedlib vjpeg.o utils.o
45 $(CXX
) $(CXXFLAGS
) -o
$@ vjpeg.o utils.o
$(LDFLAGS
) -L.
-Wl
,--as-needed
-lsjpeg
48 sharedlib
: bit_writer.o colors_rgb.o dichotomy.o enc.o fdct.o headers.o jpeg_tools.o score_7.o yuv_convert.o
49 $(CXX
) -fPIC
$(CXXFLAGS
) -Wl
,--as-needed
-shared
-Wl
,-soname
=libsjpeg.so.
$(VMAJOR
).
$(VMINOR
) -o libsjpeg.so.
$(VMAJOR
).
$(VMINOR
) $^
$(LDFLAGS
)
50 ln
-sf libsjpeg.so.
$(VMAJOR
).
$(VMINOR
) libsjpeg.so.
$(VMAJOR
)
51 ln
-sf libsjpeg.so.
$(VMAJOR
).
$(VMINOR
) libsjpeg.so
55 find
-name
'*.o' -delete
56 find
-name sjpeg
-delete
57 find
-name vjpeg
-delete
58 find
-name libsjpeg.so
-delete
59 find
-name libsjpeg.so.
$(VMAJOR
) -delete
60 find
-name libsjpeg.so.
$(VMAJOR
).
$(VMINOR
) -delete
64 mkdir
-p
$(DESTDIR
)$(BINDIR
)
65 cp
-f sjpeg
$(DESTDIR
)$(BINDIR
)
66 cp
-f vjpeg
$(DESTDIR
)$(BINDIR
)
67 mkdir
-p
$(DESTDIR
)$(MANDIR
)/man1
68 cp
-f man
/sjpeg
.1 $(DESTDIR
)$(MANDIR
)/man1
69 cp
-f man
/vjpeg
.1 $(DESTDIR
)$(MANDIR
)/man1
70 mkdir
-p
$(DESTDIR
)$(LIBDIR
)
71 cp
-f libsjpeg.so
$(DESTDIR
)$(LIBDIR
)
72 cp
-f libsjpeg.so.
$(VMAJOR
) $(DESTDIR
)$(LIBDIR
)
73 cp
-f libsjpeg.so.
$(VMAJOR
).
$(VMINOR
) $(DESTDIR
)$(LIBDIR
)
74 mkdir
-p
$(DESTDIR
)$(INCDIR
)
75 cp
-f src
/sjpeg.h
$(DESTDIR
)$(INCDIR
)