1#
2#	Makefile for dcmjpeg/apps
3#
4
5@SET_MAKE@
6
7SHELL = /bin/sh
8VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include
9srcdir = @srcdir@
10top_srcdir = @top_srcdir@
11configdir = @top_srcdir@/@configdir@
12
13include $(configdir)/@common_makefile@
14
15
16ofstddir =$(top_srcdir)/../ofstd
17ofstdinc = -I$(ofstddir)/include
18ofstdlibdir = -L$(ofstddir)/libsrc
19ofstdlib = -lofstd
20
21oflogdir = $(top_srcdir)/../oflog
22ofloginc = -I$(oflogdir)/include
23ofloglibdir = -L$(oflogdir)/libsrc
24ofloglib = -loflog
25
26dcmdatadir = $(top_srcdir)/../dcmdata
27dcmdatainc = -I$(dcmdatadir)/include
28dcmdatalibdir = -L$(dcmdatadir)/libsrc
29dcmdatalib = -ldcmdata
30
31dcmimgledir = $(top_srcdir)/../dcmimgle
32dcmimgleinc = -I$(dcmimgledir)/include
33dcmimglelibdir = -L$(dcmimgledir)/libsrc
34dcmimglelib = -ldcmimgle
35
36dcmimagedir = $(top_srcdir)/../dcmimage
37dcmimageinc = -I$(dcmimagedir)/include
38dcmimagelibdir = -L$(dcmimagedir)/libsrc
39dcmimagelib = -ldcmimage
40
41dcmjpegdir = $(top_srcdir)/../dcmjpeg
42dcmjpeginc = -I$(dcmjpegdir)/include
43dcmjpeglibdir = -L$(dcmjpegdir)/libsrc -L$(dcmjpegdir)/libijg8 -L$(dcmjpegdir)/libijg12 \
44	-L$(dcmjpegdir)/libijg16
45dcmjpeglib = -ldcmjpeg -lijg8 -lijg12 -lijg16
46
47LOCALINCLUDES = $(dcmjpeginc) $(ofstdinc) $(ofloginc) $(dcmdatainc) $(dcmimageinc) \
48	$(dcmimgleinc)
49LIBDIRS = -L$(top_srcdir)/libsrc $(dcmjpeglibdir) $(dcmimagelibdir) $(dcmimglelibdir) \
50	$(dcmdatalibdir) $(ofloglibdir) $(ofstdlibdir)
51LOCALLIBS = $(dcmjpeglib) $(dcmimagelib) $(dcmimglelib) $(dcmdatalib) $(ofloglib) \
52	$(ofstdlib) $(TIFFLIBS) $(PNGLIBS) $(ZLIBLIBS) $(CHARCONVLIBS) $(MATHLIBS)
53
54objs = dcmdjpeg.o dcmcjpeg.o dcmj2pnm.o dcmmkdir.o
55progs = dcmdjpeg dcmcjpeg dcmj2pnm dcmmkdir
56
57
58all: $(progs)
59
60dcmdjpeg: dcmdjpeg.o
61	$(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS)
62
63dcmcjpeg: dcmcjpeg.o
64	$(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS)
65
66dcmj2pnm: dcmj2pnm.o
67	$(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS)
68
69dcmmkdir: dcmmkdir.o
70	$(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS)
71
72
73install: all
74	$(configdir)/mkinstalldirs $(DESTDIR)$(bindir)
75	for prog in $(progs); do \
76		$(INSTALL_PROGRAM) $$prog$(BINEXT) $(DESTDIR)$(bindir) && $(STRIP) $(DESTDIR)$(bindir)/$$prog$(BINEXT) ;\
77	done
78
79
80clean:
81	rm -f $(objs) $(progs) $(TRASH)
82
83distclean:
84	rm -f $(objs) $(progs) $(DISTTRASH)
85
86
87dependencies:
88	$(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc  > $(DEP)
89
90include $(DEP)
91