pre-release
[hkl.git] / binoculars-ng / Makefile.am
blob1b2f292effa8e1f8d7034825f8767ed27d1b0c9d
1 SUBDIRS = binoculars
3 AM_CFLAGS=\
4         -I$(top_srcdir) \
5         -I$(top_srcdir)/binoculars-ng/binoculars \
6         -I$$($(GHCPKG) field bindings-DSL include-dirs | cut -d' ' -f 2) \
7         $(GLIB_CFLAGS)
9 AM_LDFLAGS=\
10         $(GLIB_LIBS) \
11         $(GSL_LIBS)
13 AM_GHCFLAGS=\
14         -O \
15         -i$(srcdir)/src \
16         -i$(builddir)/src \
17         -outputdir=$(builddir)/src
19 GHCLINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
20         $(LIBTOOLFLAGS) --mode=link $(GHC) $(AM_CFLAGS) $(CFLAGS) \
21         $(AM_LDFLAGS) $(LDFLAGS) $(AM_GHCFLAGS) $(GHCFLAGS) -o $@
23 .hsc.o:
24 # fake in order to let automake generate clean rules for _OBJECTS files
25         $(HSC2HS) --cflag=$(AM_CFLAGS) -o $@ $<
27 .hs.o:
28 # fake in order to let automake generate clean rules for _OBJECTS files
29         $(GHC) --make $(AM_GHCFLAGS) -c -o $@ $<
31 packages=\
32 aeson \
33 async \
34 attoparsec \
35 base \
36 bindings-DSL \
37 bytestring \
38 config-ini \
39 containers \
40 dimensional \
41 directory \
42 either \
43 errors \
44 exceptions \
45 extra \
46 filepath \
47 intervals \
48 generic-random \
49 hashable \
50 hdf5 \
51 hmatrix \
52 hmatrix-gsl \
53 ini \
54 lens \
55 monad-logger \
56 monad-loops \
57 mtl \
58 optparse-applicative \
59 path \
60 path-io \
61 pipes \
62 pipes-safe \
63 QuickCheck \
64 quickcheck-text \
65 terminal-progress-bar \
66 text \
67 transformers \
68 unordered-containers \
69 vector
71 hsc_sources=\
72         src/Hkl/C/Hkl.hsc \
73         src/Hkl/C/Binoculars.hsc
75 sources=\
76         src/Hkl.hs \
77         src/Hkl/Binoculars.hs \
78         src/Hkl/Binoculars/Command.hs \
79         src/Hkl/Binoculars/Common.hs \
80         src/Hkl/Binoculars/Config.hs \
81         src/Hkl/Binoculars/Config/Common.hs \
82         src/Hkl/Binoculars/Config/Sample.hs \
83         src/Hkl/Binoculars/Pipes.hs \
84         src/Hkl/Binoculars/Projections.hs \
85         src/Hkl/Binoculars/Projections/Angles.hs \
86         src/Hkl/Binoculars/Projections/Hkl.hs \
87         src/Hkl/Binoculars/Projections/QCustom.hs \
88         src/Hkl/Binoculars/Projections/Test.hs \
89         src/Hkl/C.hs \
90         src/Hkl/DArray.hs \
91         src/Hkl/DataSource.hs \
92         src/Hkl/Detector.hs \
93         src/Hkl/Engine.hs \
94         src/Hkl/Exception.hs \
95         src/Hkl/Geometry.hs \
96         src/Hkl/H5.hs \
97         src/Hkl/HKD.hs \
98         src/Hkl/Image.hs \
99         src/Hkl/Lattice.hs \
100         src/Hkl/MyMatrix.hs \
101         src/Hkl/Orphan.hs \
102         src/Hkl/Parameter.hs \
103         src/Hkl/Pipes.hs \
104         src/Hkl/Repa.hs \
105         src/Hkl/Sample.hs \
106         src/Hkl/Types.hs \
107         src/Hkl/Utils.hs \
108         src/Paths_hkl.hs \
109         app/Main.hs
111 CLEANFILES=\
112         $(hsc_sources:.hsc=.dyn_hi) \
113         $(hsc_sources:.hsc=.dyn_o) \
114         $(hsc_sources:.hsc=.hi) \
115         $(hsc_sources:.hsc=.hs) \
116         $(hsc_sources:.hsc=.o) \
117         $(sources:.hs=.dyn_hi) \
118         $(sources:.hs=.dyn_o) \
119         $(sources:.hs=.hi) \
120         $(sources:.hs=.o) \
121         cabal.project.local \
122         src/Hkl/H5_stub.h \
123         src/Main.dyn_hi \
124         src/Main.dyn_o \
125         src/Main.hi
128 bin_PROGRAMS = binoculars-ng
129 binoculars_ng_SOURCES = $(hsc_sources) $(sources)
130 binoculars_ng_LDADD = \
131         $(top_builddir)/hkl/libhkl.la \
132         $(top_builddir)/binoculars-ng/binoculars/libhkl-binoculars.la
133 binoculars_ng_LINK=$(GHCLINK) $(srcdir)/app/Main.hs
135 binoculars-ng$(EXEEXT): $(binoculars_ng_DEPENDENCIES) $(EXTRA_binoculars_ng_DEPENDENCIES)
136         @rm -f binoculars-ng$(EXEEXT)
137         mkdir -p $(builddir)/src/Hkl/C/
138         @rm -f src/Hkl/C/Hkl.hs
139         $(HSC2HS) --cflag=$(AM_CFLAGS) -o src/Hkl/C/Hkl.hs $(srcdir)/src/Hkl/C/Hkl.hsc
140         @rm -f src/Hkl/C/Binoculars.hs
141         $(HSC2HS) --cflag=$(AM_CFLAGS) -o src/Hkl/C/Binoculars.hs $(srcdir)/src/Hkl/C/Binoculars.hsc
142         $(AM_V_GEN)$(binoculars_ng_LINK) $(binoculars_ng_LDADD) $(LIBS)
145 # when developping with cabal
146 cabal:
147         @rm -f cabal.project.local
148         cabal configure \
149                 --extra-lib-dirs=$(abs_top_builddir)/hkl/.libs \
150                 --extra-lib-dirs=$(abs_top_builddir)/binoculars-ng/binoculars/.libs \
151                 --extra-include-dirs=$(abs_top_srcdir) \
152                 --extra-include-dirs=$(abs_top_srcdir)/binoculars-ng/binoculars \
153                 -fuseHklDev \
154                 --enable-profiling \
155                 --enable-library-profiling \
156                 --library-profiling-detail=toplevel-functions \
157                 --profiling-detail=toplevel-functions \
158                 --enable-optimization
159         $(EMACS) -f haskell-compile
161 clean-local:
162         cabal clean
165 .PHONY: cabal