2010-10-18 00:42:46 +02:00
|
|
|
#mj2 Makefile.nix
|
2010-10-05 12:33:15 +02:00
|
|
|
include ../config.nix
|
|
|
|
|
|
|
|
CFLAGS = -Wall
|
|
|
|
|
|
|
|
INSTALL_BIN = $(prefix)/bin
|
|
|
|
USERLIBS = -lm
|
2010-12-08 12:06:41 +01:00
|
|
|
INCLUDE = -I.. -I. -I../libopenjpeg -I../common
|
2010-10-05 12:33:15 +02:00
|
|
|
|
|
|
|
ifeq ($(WITH_LCMS2),yes)
|
|
|
|
INCLUDE += $(LCMS2_INCLUDE)
|
|
|
|
USERLIBS += $(LCMS2_LIB)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(WITH_LCMS1),yes)
|
|
|
|
INCLUDE += $(LCMS1_INCLUDE)
|
|
|
|
USERLIBS += $(LCMS1_LIB)
|
|
|
|
endif
|
|
|
|
|
|
|
|
CFLAGS += $(INCLUDE) -lstdc++ # -g -p -pg
|
|
|
|
|
2010-12-10 05:27:40 +01:00
|
|
|
ifeq ($(ENABLE_SHARED),yes)
|
|
|
|
ELIB = ../libopenjpeg.so.$(MAJOR).$(MINOR).$(BUILD)
|
|
|
|
else
|
|
|
|
ELIB = ../libopenjpeg.a
|
|
|
|
endif
|
|
|
|
|
2010-10-05 12:33:15 +02:00
|
|
|
all: frames_to_mj2 mj2_to_frames extract_j2k_from_mj2 wrap_j2k_in_mj2
|
|
|
|
install -d ../bin
|
|
|
|
install frames_to_mj2 mj2_to_frames extract_j2k_from_mj2 \
|
|
|
|
wrap_j2k_in_mj2 ../bin
|
|
|
|
|
2010-12-10 05:27:40 +01:00
|
|
|
frames_to_mj2: frames_to_mj2.c $(ELIB)
|
2010-12-08 12:06:41 +01:00
|
|
|
$(CC) $(CFLAGS) ../common/getopt.c mj2_convert.c mj2.c frames_to_mj2.c \
|
2010-12-10 05:27:40 +01:00
|
|
|
-o frames_to_mj2 $(ELIB) $(USERLIBS)
|
2010-10-05 12:33:15 +02:00
|
|
|
|
2010-12-10 05:27:40 +01:00
|
|
|
mj2_to_frames: mj2_to_frames.c $(ELIB)
|
2010-12-08 12:06:41 +01:00
|
|
|
$(CC) $(CFLAGS) ../common/getopt.c mj2_convert.c mj2.c \
|
|
|
|
../common/color.c mj2_to_frames.c \
|
2010-12-10 05:27:40 +01:00
|
|
|
-o mj2_to_frames $(ELIB) $(USERLIBS)
|
2010-10-05 12:33:15 +02:00
|
|
|
|
2010-12-10 05:27:40 +01:00
|
|
|
extract_j2k_from_mj2: extract_j2k_from_mj2.c $(ELIB)
|
2010-10-05 12:33:15 +02:00
|
|
|
$(CC) $(CFLAGS) mj2.c extract_j2k_from_mj2.c \
|
2010-12-10 05:27:40 +01:00
|
|
|
-o extract_j2k_from_mj2 $(ELIB) $(USERLIBS)
|
2010-10-05 12:33:15 +02:00
|
|
|
|
2010-12-10 05:27:40 +01:00
|
|
|
wrap_j2k_in_mj2: wrap_j2k_in_mj2.c $(ELIB)
|
2010-10-05 12:33:15 +02:00
|
|
|
$(CC) $(CFLAGS) mj2.c wrap_j2k_in_mj2.c \
|
2010-12-10 05:27:40 +01:00
|
|
|
-o wrap_j2k_in_mj2 $(ELIB) $(USERLIBS)
|
2010-10-05 12:33:15 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f frames_to_mj2 mj2_to_frames extract_j2k_from_mj2 wrap_j2k_in_mj2
|
|
|
|
|
|
|
|
install: all
|
|
|
|
install -d $(DESTDIR)$(INSTALL_BIN)
|
|
|
|
install -m 755 -o root -g root frames_to_mj2 $(DESTDIR)$(INSTALL_BIN)
|
|
|
|
install -m 755 -o root -g root mj2_to_frames $(DESTDIR)$(INSTALL_BIN)
|
|
|
|
install -m 755 -o root -g root extract_j2k_from_mj2 $(DESTDIR)$(INSTALL_BIN)
|
|
|
|
install -m 755 -o root -g root wrap_j2k_in_mj2 $(DESTDIR)$(INSTALL_BIN)
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
rm -f $(DESTDIR)$(INSTALL_BIN)/frames_to_mj2
|
|
|
|
rm -f $(DESTDIR)$(INSTALL_BIN)/mj2_to_frames
|
|
|
|
rm -f $(DESTDIR)$(INSTALL_BIN)/extract_j2k_from_mj2
|
|
|
|
rm -f $(DESTDIR)$(INSTALL_BIN)/wrap_j2k_in_mj2
|