3 # makefile for OpenJPEG library
5 CFLAGS = -Wall -O3 -fno-strength-reduce -fomit-frame-pointer
19 OBJ_DIR = $(OBJ_DIR_W32)
20 LIB_DIR = $(LIB_DIR_W32)
21 all: $(OBJ_DIR) $(LIB_DIR) \
22 $(LIB_DIR)/libopenjpeg.a $(LIB_DIR)/libopenjpeg.dll
28 all: $(OBJ_DIR) $(LIB_DIR) \
29 $(LIB_DIR)/libopenjpeg.a $(LIB_DIR)/libopenjpeg.so
39 $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
41 $(OBJ_DIR)/bio.o: bio.c bio.h
42 $(OBJ_DIR)/cio.o: cio.c cio.h
43 $(OBJ_DIR)/dwt.o: dwt.c dwt.h int.h fix.h tcd.h
44 $(OBJ_DIR)/fix.o: fix.c fix.h
45 $(OBJ_DIR)/int.o: int.c
46 $(OBJ_DIR)/j2k.o: j2k.c j2k.h cio.h tcd.h dwt.h int.h
47 $(OBJ_DIR)/mct.o: mct.c mct.h fix.h
48 $(OBJ_DIR)/mqc.o: mqc.c mqc.h
50 $(OBJ_DIR)/pi.o: pi.c pi.h int.h
51 $(OBJ_DIR)/raw.o: raw.c raw.h
52 $(OBJ_DIR)/t1.o: t1.c t1.h j2k.h mqc.h raw.h int.h mct.h dwt.h fix.h
53 $(OBJ_DIR)/t2.o: t2.c t2.h tcd.h bio.h j2k.h pi.h tgt.h int.h cio.h
54 $(OBJ_DIR)/tcd.o: tcd.c tcd.h int.h t1.h t2.h dwt.h mct.h
55 $(OBJ_DIR)/tgt.o: tgt.c tgt.h bio.h
56 $(OBJ_DIR)/jpt.o: jpt.c jpt.h cio.h
57 $(OBJ_DIR)/jp2.o: jp2.c jp2.h
59 COM_OBJS = $(addprefix $(OBJ_DIR)/, j2k.o bio.o cio.o dwt.o fix.o int.o mct.o \
60 mqc.o pi.o t1.o t2.o tgt.o tcd.o raw.o jpt.o jp2.o)
62 $(LIB_DIR)/libopenjpeg.a: ${COM_OBJS}
65 $(LIB_DIR)/libopenjpeg.dll: ${COM_OBJS}
66 ${CC} -s -shared -Wl,-soname,libopenjpeg.dll -o $@ $^
68 $(LIB_DIR)/libopenjpeg.so.1.0: ${COM_OBJS}
69 ${CC} -s -shared -Wl,-soname,libopenjpeg.so.1 -o $@ $^
71 $(LIB_DIR)/libopenjpeg.so.1: $(LIB_DIR)/libopenjpeg.so.1.0
72 ln -s libopenjpeg.so.1.0 $(LIB_DIR)/libopenjpeg.so.1
74 $(LIB_DIR)/libopenjpeg.so: $(LIB_DIR)/libopenjpeg.so.1
75 ln -s libopenjpeg.so.1 $(LIB_DIR)/libopenjpeg.so
78 rm -f $(OBJ_DIR_W32)/* $(OBJ_DIR)/* $(LIB_DIR_W32)/* $(LIB_DIR)/*