fixed wrong patch with the return value of fgets into convert.c file
[openjpeg.git] / applications / codec / Makefile.nix
1 #codec Makefile
2 include ../config.nix
3
4 CFLAGS = -Wall
5
6 INSTALL_BIN = $(prefix)/bin
7
8 INCLUDE = -I.. -I. -I../libopenjpeg -I../common
9 USERLIBS = -lm
10
11 ifeq ($(WITH_TIFF),yes)
12 INCLUDE += $(TIFF_INCLUDE)
13 USERLIBS += $(TIFF_LIB)
14 endif
15
16 ifeq ($(WITH_PNG),yes)
17 INCLUDE += $(PNG_INCLUDE)
18 USERLIBS += $(PNG_LIB)
19 endif
20
21 ifeq ($(WITH_LCMS2),yes)
22 INCLUDE += $(LCMS2_INCLUDE)
23 USERLIBS += $(LCMS2_LIB)
24 endif
25
26 ifeq ($(WITH_LCMS1),yes)
27 INCLUDE += $(LCMS1_INCLUDE)
28 USERLIBS += $(LCMS1_LIB)
29 endif
30
31 CFLAGS += $(INCLUDE) -lstdc++ # -g -p -pg
32
33 all: j2k_to_image image_to_j2k j2k_dump
34         install -d ../bin
35         install j2k_to_image image_to_j2k j2k_dump ../bin
36
37 ifeq ($(ENABLE_SHARED),yes)
38 ELIB = ../libopenjpeg.so.$(MAJOR).$(MINOR).$(BUILD)
39 else
40 ELIB = ../libopenjpeg.a
41 endif
42
43 j2k_to_image: j2k_to_image.c $(ELIB)
44         $(CC)  $(CFLAGS) ../common/getopt.c index.c convert.c \
45         ../common/color.c j2k_to_image.c \
46         -o j2k_to_image  $(ELIB) $(USERLIBS)
47
48 image_to_j2k: image_to_j2k.c  $(ELIB)
49         $(CC) $(CFLAGS) ../common/getopt.c index.c convert.c image_to_j2k.c \
50         -o image_to_j2k  $(ELIB) $(USERLIBS)
51
52 j2k_dump: j2k_dump.c  $(ELIB)
53         $(CC) $(CFLAGS) ../common/getopt.c index.c j2k_dump.c \
54         -o j2k_dump $(ELIB) $(USERLIBS)
55
56 clean:
57         rm -f j2k_to_image image_to_j2k j2k_dump
58
59 install: all
60         install -d $(DESTDIR)$(INSTALL_BIN)
61         install -m 755 -o root -g root j2k_to_image $(DESTDIR)$(INSTALL_BIN)
62         install -m 755 -o root -g root image_to_j2k $(DESTDIR)$(INSTALL_BIN)
63         install -m 755 -o root -g root j2k_dump $(DESTDIR)$(INSTALL_BIN)
64
65 uninstall:
66         rm -f $(DESTDIR)$(INSTALL_BIN)/j2k_to_image
67         rm -f $(DESTDIR)$(INSTALL_BIN)/image_to_j2k
68         rm -f $(DESTDIR)$(INSTALL_BIN)/j2k_dump