forked from yayahjb/cbflib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile_OSX
2894 lines (2597 loc) · 107 KB
/
Makefile_OSX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
######################################################################
# Makefile - command file for make to create CBFlib #
# #
# Version 0.9.7 28 June 2021 #
# #
# Paul Ellis and #
# Herbert J. Bernstein ([email protected]) #
# #
# (C) Copyright 2006 - 2021 Herbert J. Bernstein #
# #
######################################################################
######################################################################
# #
# YOU MAY REDISTRIBUTE THE CBFLIB PACKAGE UNDER THE TERMS OF THE GPL #
# #
# ALTERNATIVELY YOU MAY REDISTRIBUTE THE CBFLIB API UNDER THE TERMS #
# OF THE LGPL #
# #
######################################################################
########################### GPL NOTICES ##############################
# #
# This program is free software; you can redistribute it and/or #
# modify it under the terms of the GNU General Public License as #
# published by the Free Software Foundation; either version 2 of #
# (the License, or (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program; if not, write to the Free Software #
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA #
# 02111-1307 USA #
# #
######################################################################
######################### LGPL NOTICES ###############################
# #
# This library is free software; you can redistribute it and/or #
# modify it under the terms of the GNU Lesser General Public #
# License as published by the Free Software Foundation; either #
# version 2.1 of the License, or (at your option) any later version. #
# #
# This library is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
# Lesser General Public License for more details. #
# #
# You should have received a copy of the GNU Lesser General Public #
# License along with this library; if not, write to the Free #
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, #
# MA 02110-1301 USA #
# #
######################################################################
######################################################################
# #
# Stanford University Notices #
# for the CBFlib software package that incorporates SLAC software #
# on which copyright is disclaimed #
# #
# This software #
# ------------- #
# The term "this software", as used in these Notices, refers to #
# those portions of the software package CBFlib that were created by #
# employees of the Stanford Linear Accelerator Center, Stanford #
# University. #
# #
# Stanford disclaimer of copyright #
# -------------------------------- #
# Stanford University, owner of the copyright, hereby disclaims its #
# copyright and all other rights in this software. Hence, anyone #
# may freely use it for any purpose without restriction. #
# #
# Acknowledgement of sponsorship #
# ------------------------------ #
# This software was produced by the Stanford Linear Accelerator #
# Center, Stanford University, under Contract DE-AC03-76SFO0515 with #
# the Department of Energy. #
# #
# Government disclaimer of liability #
# ---------------------------------- #
# Neither the United States nor the United States Department of #
# Energy, nor any of their employees, makes any warranty, express or #
# implied, or assumes any legal liability or responsibility for the #
# accuracy, completeness, or usefulness of any data, apparatus, #
# product, or process disclosed, or represents that its use would #
# not infringe privately owned rights. #
# #
# Stanford disclaimer of liability #
# -------------------------------- #
# Stanford University makes no representations or warranties, #
# express or implied, nor assumes any liability for the use of this #
# software. #
# #
# Maintenance of notices #
# ---------------------- #
# In the interest of clarity regarding the origin and status of this #
# software, this and all the preceding Stanford University notices #
# are to remain affixed to any copy or derivative of this software #
# made or distributed by the recipient and are to be affixed to any #
# copy of software made or distributed by the recipient that #
# contains a copy or derivative of this software. #
# #
# Based on SLAC Software Notices, Set 4 #
# OTT.002a, 2004 FEB 03 #
######################################################################
######################################################################
# NOTICE #
# Creative endeavors depend on the lively exchange of ideas. There #
# are laws and customs which establish rights and responsibilities #
# for authors and the users of what authors create. This notice #
# is not intended to prevent you from using the software and #
# documents in this package, but to ensure that there are no #
# misunderstandings about terms and conditions of such use. #
# #
# Please read the following notice carefully. If you do not #
# understand any portion of this notice, please seek appropriate #
# professional legal advice before making use of the software and #
# documents included in this software package. In addition to #
# whatever other steps you may be obliged to take to respect the #
# intellectual property rights of the various parties involved, if #
# you do make use of the software and documents in this package, #
# please give credit where credit is due by citing this package, #
# its authors and the URL or other source from which you obtained #
# it, or equivalent primary references in the literature with the #
# same authors. #
# #
# Some of the software and documents included within this software #
# package are the intellectual property of various parties, and #
# placement in this package does not in any way imply that any #
# such rights have in any way been waived or diminished. #
# #
# With respect to any software or documents for which a copyright #
# exists, ALL RIGHTS ARE RESERVED TO THE OWNERS OF SUCH COPYRIGHT. #
# #
# Even though the authors of the various documents and software #
# found here have made a good faith effort to ensure that the #
# documents are correct and that the software performs according #
# to its documentation, and we would greatly appreciate hearing of #
# any problems you may encounter, the programs and documents any #
# files created by the programs are provided **AS IS** without any *
# warranty as to correctness, merchantability or fitness for any #
# particular or general use. #
# #
# THE RESPONSIBILITY FOR ANY ADVERSE CONSEQUENCES FROM THE USE OF #
# PROGRAMS OR DOCUMENTS OR ANY FILE OR FILES CREATED BY USE OF THE #
# PROGRAMS OR DOCUMENTS LIES SOLELY WITH THE USERS OF THE PROGRAMS #
# OR DOCUMENTS OR FILE OR FILES AND NOT WITH AUTHORS OF THE #
# PROGRAMS OR DOCUMENTS. #
######################################################################
######################################################################
# #
# The IUCr Policy #
# for the Protection and the Promotion of the STAR File and #
# CIF Standards for Exchanging and Archiving Electronic Data #
# #
# Overview #
# #
# The Crystallographic Information File (CIF)[1] is a standard for #
# information interchange promulgated by the International Union of #
# Crystallography (IUCr). CIF (Hall, Allen & Brown, 1991) is the #
# recommended method for submitting publications to Acta #
# Crystallographica Section C and reports of crystal structure #
# determinations to other sections of Acta Crystallographica #
# and many other journals. The syntax of a CIF is a subset of the #
# more general STAR File[2] format. The CIF and STAR File approaches #
# are used increasingly in the structural sciences for data exchange #
# and archiving, and are having a significant influence on these #
# activities in other fields. #
# #
# Statement of intent #
# #
# The IUCr's interest in the STAR File is as a general data #
# interchange standard for science, and its interest in the CIF, #
# a conformant derivative of the STAR File, is as a concise data #
# exchange and archival standard for crystallography and structural #
# science. #
# #
# Protection of the standards #
# #
# To protect the STAR File and the CIF as standards for #
# interchanging and archiving electronic data, the IUCr, on behalf #
# of the scientific community, #
# #
# # holds the copyrights on the standards themselves, *
# #
# # owns the associated trademarks and service marks, and *
# #
# # holds a patent on the STAR File. *
# #
# These intellectual property rights relate solely to the #
# interchange formats, not to the data contained therein, nor to #
# the software used in the generation, access or manipulation of #
# the data. #
# #
# Promotion of the standards #
# #
# The sole requirement that the IUCr, in its protective role, #
# imposes on software purporting to process STAR File or CIF data #
# is that the following conditions be met prior to sale or #
# distribution. #
# #
# # Software claiming to read files written to either the STAR *
# File or the CIF standard must be able to extract the pertinent #
# data from a file conformant to the STAR File syntax, or the CIF #
# syntax, respectively. #
# #
# # Software claiming to write files in either the STAR File, or *
# the CIF, standard must produce files that are conformant to the #
# STAR File syntax, or the CIF syntax, respectively. #
# #
# # Software claiming to read definitions from a specific data *
# dictionary approved by the IUCr must be able to extract any #
# pertinent definition which is conformant to the dictionary #
# definition language (DDL)[3] associated with that dictionary. #
# #
# The IUCr, through its Committee on CIF Standards, will assist #
# any developer to verify that software meets these conformance #
# conditions. #
# #
# Glossary of terms #
# #
# [1] CIF: is a data file conformant to the file syntax defined #
# at http://www.iucr.org/iucr-top/cif/spec/index.html #
# #
# [2] STAR File: is a data file conformant to the file syntax #
# defined at http://www.iucr.org/iucr-top/cif/spec/star/index.html #
# #
# [3] DDL: is a language used in a data dictionary to define data #
# items in terms of "attributes". Dictionaries currently approved #
# by the IUCr, and the DDL versions used to construct these #
# dictionaries, are listed at #
# http://www.iucr.org/iucr-top/cif/spec/ddl/index.html #
# #
# Last modified: 30 September 2000 #
# #
# IUCr Policy Copyright (C) 2000 International Union of #
# Crystallography #
######################################################################
.DELETE_ON_ERROR:
# Version string
VERSION = 0.9.7
#
# Directories
#
ROOT = $(PWD)
LIB = $(ROOT)/lib
SOLIB = $(ROOT)/solib
JCBF = $(ROOT)/jcbf
JAVADIR = $(ROOT)/java
BIN = $(ROOT)/bin
SRC = $(ROOT)/src
INCLUDE = $(ROOT)/include
M4 = $(ROOT)/m4
PY2CBF = $(ROOT)/py2cbf
PY3CBF = $(ROOT)/pycbf
EXAMPLES = $(ROOT)/examples
TEMPLATES= $(ROOT)/templates
DECTRIS_EXAMPLES = $(EXAMPLES)/dectris_cbf_template_test
DOC = $(ROOT)/doc
MINICBF_TEST = $(ROOT)/minicbf_test
GRAPHICS = $(ROOT)/html_graphics
DATADIRI = $(ROOT)/../CBFlib_$(VERSION)_Data_Files_Input
DATADIRO = $(ROOT)/../CBFlib_$(VERSION)_Data_Files_Output
CBF_PREFIX ?= $(HOME)
#
# Comment out the next line if scratch test files should be retained
#
CLEANTESTS = yes
MSYS2=no
CBFLIB_DONT_USE_LOCAL_HDF5?=no
CBFLIB_DONT_USE_LZ4?=no
CBFLIB_DONT_USE_BSHUF?=no
CBFLIB_DONT_USE_LOCAL_NUWEB ?= no
ifeq ($(CBFLIB_DONT_USE_LOCAL_NUWEB),yes)
NUWEB=nuweb
NUWEB_DEP=
NUWEB_DEP2=
else
NUWEB=$(BIN)/nuweb
NUWEB_DEP=nuweb-1.61
NUWEB_DEP2=$(BIN)/nuweb
endif
CBFLIB_DONT_HAVE_FGETLN ?= yes
ifeq ($(CBFLIB_DONT_HAVE_FGETLN),yes)
SRC_FGETLN = $(SRC)/fgetln.c
else
SRC_FGETLN =
endif
CBFLIB_DONT_USE_PY2CIFRW ?= no
ifneq ($(CBFLIB_DONT_USE_PY2CIFRW),yes)
#
# Definitions to get versions of python2 PyCifRW and PLY
#
PY2CIFRW ?= PyCifRW-4.1
PY2PLY = ply-3.2
PY2CIFRWFLAG = -DCBF_USE_PYCIFRW
PY2CIFRW_PREFIX ?= $(HOME)/.local
endif
CBFLIB_DONT_USE_PY3CIFRW ?= no
ifneq ($(CBFLIB_DONT_USE_PY3CIFRW),yes)
#
# Definitions to get versions of python3 PyCifRW and PLY
#
PY3CIFRW ?= PyCifRW-4.3_rev_19Jun21
PY3PLY = ply-3.11
PY3CIFRWFLAG = -DCBF_USE_PYCIFRW
PY3CIFRW_PREFIX ?= $(HOME)/.local
endif
#
# Definition to get a version of tifflib to support tiff2cbf
#
TIFF ?= tiff-4.0.6_rev_3Nov16
TIFF_PREFIX ?= $(PWD)
TIFF_INSTALL = $(TIFF)_INSTALL
#
# Definitions to get a version of HDF5
#
ifneq ($(HDF5_PREFIX),) # already installed on system
CBFLIB_DONT_USE_LOCAL_HDF5 = yes
HDF5CFLAGS=-DH5_USE_110_API
endif
ifneq ($(CBFLIB_DONT_USE_LOCAL_HDF5),yes)
HDF5_PREFIX ?= $(PWD)
HDF5 ?= hdf5-1.12.0
#HDF5 ?= hdf5-1.10.6
#HDF5 = hdf5-1.8.18
#HDF5 = hdf5-1.10.5
ifeq ($(HDF5),hdf5-1.12.0)
HDF5CFLAGS=-DH5_USE_110_API
else
HDF5CFLAGS=
endif
HDF5dep = $(HDF5)
HDF5_INSTALL = $(HDF5)_INSTALL
ifneq ($(MSYS2),yes)
HDF5LIBS_LOCAL = $(LIB)/libhdf5.a
HDF5LIBS_SYSTEM = -lz -ldl
HDF5SOLIBS_LOCAL = -L$(LIB) -lhdf5
HDF5SOLIBS_SYSTEM = -lz
else
HDF5LIBS_LOCAL = -L$(LIB) -lhdf5 -lhdf5.dll
HDF5LIBS_SYSTEM = -lz -ldl
HDF5SOLIBS_LOCAL = -L$(LIB) -lhdf5 -lhdf5.dll
HDF5SOLIBS_SYSTEM = -lz
endif
else
HDF5 =
HDF5dep =
HDF5_INSTALL =
HDF5LIBS_LOCAL =
ifneq ($(HDF5_PREFIX),)
HDF5lib = -L$(HDF5_PREFIX)/lib
endif
ifneq ($(MSYS2),yes)
HDF5LIBS_SYSTEM = $(HDF5lib) -lhdf5 -lz -ldl
HDF5SOLIBS_LOCAL =
HDF5SOLIBS_SYSTEM = $(HDF5lib) -lhdf5 -lz
else
HDF5LIBS_SYSTEM = $(HDF5lib) -lhdf5 -lhdf5.dll -lz -ldl
HDF5SOLIBS_LOCAL =
HDF5SOLIBS_SYSTEM = $(HDF5lib) -lhdf5 -lhdf5.dll -lz
endif
endif
HDF5REGISTER ?= --register manual
ifneq ($(HDF5_PREFIX),)
HDF5include = -I$(HDF5_PREFIX)/include
endif
ifneq ($(MSYS2),yes)
H5DUMP = $(HDF5_PREFIX)/bin/h5dump
else
H5DUMP = /MINGW32/bin/h5dump
endif
CBFLIB_DONT_USE_LZ4 ?= no
ifneq ($(CBFLIB_DONT_USE_LZ4),yes)
#
# Definitions to get a version of HDF5Plugin for LZ4
#
ifneq ($(MSYS2),yes)
LZ4 ?= HDF5Plugin_5Jun21
else
LZ4 ?= HDF5-External-Filter-Plugins
endif
LZ4dep = $(LZ4)
LZ4src = $(LZ4)/src
LZ4include = $(LZ4)/include
LZ4SOLIBS = -L$(SOLIB) -lh5zlz4
else
LZ4SOLIBS =
LZ4dep =
endif
CBFLIB_DONT_USE_BSHUF ?= no
ifneq ($(CBFLIB_DONT_USE_BSHUF),yes)
#
# Definitions to get a version of HDF5Plugin for BSHUFFLE WITH LZ4
#
BSHUF ?= bitshuffle-0.2.2.1_15Jun16
BSUFdep = $(BSHUF)
BSHUFsrc = $(BSHUF)/src
BSHUFinclude = $(BSHUF)/src
BSHUFSOLIBS = -L$(SOLIB) -lh5zbshuf
BSHUFFILTER = libbshuf_h5filter
else
BSHUFSOLIBS =
BSHUFdep =
endif
CBFLIB_DONT_USE_BLOSC ?= no
ifneq ($(CBFLIB_DONT_USE_BLOSC),yes)
#
# Definitions to get a version of HDF5Plugin for BLOSC
#
BLOSC = ?c-blosc_4Sep16.tar.gz
BLOSCdep = $(BLOSC)
BLOSCFILTER = hdf5-blosc_2Sep16.tar.gz
BLOSCsrc = $(BLOSC)/src
BLOSCinclude = $(BLOSC)/src
BLOSCSOLIBS = -L$(SOLIB) -lh5zbshuf
BLOSCFILTER = libbshuf_h5filter
else
BLOSCSOLIBS =
BLOSCdep =
endif
#
# Definition of python to use
#
PYTHON2 ?= python2
PYTHON3 ?= python3
#
# Definitions to get a stable version of regex
#
REGEX_PREFIX ?= $(PWD)
ifneq ($(REGEX_PREFIX),$(PWD))
CBFLIB_DONT_USE_LOCAL_REGEX ?= yes
endif
REGEX_LIBDIR ?= $(REGEX_PREFIX)/lib
ifneq ($(CBFLIB_DONT_USE_LOCAL_REGEX),yes)
REGEX ?= pcre-8.38
REGEXDEP = $(REGEX)
REGEX_INSTALL = $(REGEX)_INSTALL
REGEX_LIB ?= pcreposix
REGEX_LIB2 ?= pcre
ifneq ($(MSYS2),yes)
REGEX_LIBS ?= -L $(REGEX_LIBDIR) -l$(REGEX_LIB) -l$(REGEX_LIB2)
REGEX_LIBS_STATIC = $(LIB)/libpcreposix.a $(LIB)/libpcre.a
else
REGEX_LIBS ?= -L $(REGEX_LIBDIR) -l$(REGEX_LIB) -l$(REGEX_LIB).dll -l$(REGEX_LIB2) -l$(REGEX_LIB2).dll
REGEX_LIBS_STATIC = $(REGEX_LIBS)
endif
REGEX_INCLUDES ?= -I $(REGEX_PREFIX)
else
REGEX =
REGEXDEP =
REGEX_INSTALL =
REGEX_LIB ?=
REGEX_LIB2 ?=
REGEX_LIBS ?=
REGEX_INCLUDES ?=
endif
# Program to use to retrieve a URL
DOWNLOAD ?= wget -N
#DOWNLOAD ?= curl -O -L
# Flag to control symlinks versus copying
SLFLAGS = --use_ln
LN = ln -s -f
#
# Program to use to pack shars
#
SHAR = /usr/bin/shar
#SHAR = /usr/local/bin/gshar
#
# Program to use to create archives
#
AR = /usr/bin/ar
#
# Program to use to add an index to an archive
#
RANLIB = /usr/bin/ranlib
#
# Program to use to generate a signature
#
#SIGNATURE ?= /usr/bin/openssl dgst -md5
#SIGNATURE ?= (/usr/bin/openssl dgst -md5 | sed "s/^.*= //")
SIGNATURE ?= ( cat > md5tmp; cmake -E md5sum md5tmp| sed "s/ .*//")
#
# Pipe command to extract all but the first line of a text file
#
ALLBUTONE = tail -n +2
#
# Extension for signatures of files
#
SEXT = .md5
# Default shell
SHELL = bash
# call to time a command
#TIME =
#TIME = time
#
# Program to display differences between files
#
DIFF = diff -u -b
#
# Program to generate wrapper classes for Python
#
PYSWIG = swig -python
#
# Program to generate wrapper classes for Java
#
JSWIG = swig -java
#
# Java SDK root directory
#
ifeq ($(JDKDIR),)
JDKDIR = /etc/alternatives/java_sdk
endif
#
# Launcher for Java
#
JAVA = $(JDKDIR)/bin/java
#
# Compiler for Java
#
JAVAC = $(JDKDIR)/bin/javac
#
# Java archiver for compiled classes
#
JAR = $(JDKDIR)/bin/jar
ifneq ($(CBF_DONT_USE_LONG_LONG),)
NOLLFLAG = -DCBF_DONT_USE_LONG_LONG
else
NOLLFLAG =
endif
ifneq ($(CBF_NO_REGEX),)
CBF_REGEXFLAG = -DCBF_NO_REGEX
else
CBF_REGEXFLAG = -DCBF_REGEXLIB_REGEX
endif
ifneq ($(CBF_USE_ULP),)
ULPFLAG = -DCBF_USE_ULP
else
ULPFLAG =
endif
ifneq ($(CBFLIB_DONT_USE_LZ4),yes)
LZ4FLAG = -DCBF_H5Z_USE_LZ4
else
LZ4FLAG =
endif
ifneq ($(CBFLIB_DONT_USE_BSHUF),yes)
BSHUFFLAG = -DCBF_H5Z_USE_BSHUF
else
BSHUFFLAG =
endif
MISCFLAG = $(NOLLFLAG) $(ULPFLAG)
#
# PY2CBF definitions
#
PY2CBFEXT = so
PY2CBFBOPT =
PY2CBFIOPT =
SETUP_PY = setup.py
PY2INSTALLSETUP_PY = py2setup.py
#
# PY3CBF definitions
#
PY3CBFEXT = so
PY3CBFBOPT =
PY3CBFIOPT =
SETUP_PY = setup.py
PY3INSTALLSETUP_PY = py3setup.py
#
# Set the compiler and flags
#
#########################################################
#
# Appropriate compiler definitions for MAC OS X
# Also change defintion of DOWNLOAD
#
#########################################################
CC = gcc
C++ = g++
CFLAGS = -g -O2 -Wall -std=c99 -pedantic $(HDF5CFLAGS)
LDFLAGS =
F90C = gfortran
F90FLAGS = -g -fno-range-check -fallow-invalid-boz
F90LDFLAGS = -bind_at_load
SOCFLAGS = -fPIC
SOLDFLAGS = -dynamiclib -Wl,-rpath,$(CBF_PREFIX)/lib
JAVAINCLUDES = -I$(JDKDIR)/include -I$(JDKDIR)/include/darwin
LDPREFIX = DYLD_LIBRARY_PATH=$(SOLIB):$$DYLD_LIBRARY_PATH;export DYLD_LIBRARY_PATH;
RUNLDPREFIX = DYLD_LIBRARY_PATH=$(CBF_PREFIX)/lib:$$DYLD_LIBRARY_PATH;export DYLD_LIBRARY_PATH;
EXTRALIBS = -lm
M4FLAGS = -Dfcb_bytes_in_rec=131072
TIME = time
DOWNLOAD = /sw/bin/wget -N
SO_EXT = dylib
ifneq ($(NOFORTRAN),)
F90C =
endif
#
# URLs from which to retrieve the data directories
#
DATAURLBASE = http://downloads.sf.net/cbflib/
DATAURLI = $(DATAURLBASE)/CBFlib_$(VERSION)_Data_Files_Input.tar.gz
DATAURLO = $(DATAURLBASE)/CBFlib_$(VERSION)_Data_Files_Output.tar.gz
#
# URLs from which to retrieve needed external package snapshots
#
ifneq ($(CBFLIB_DONT_USE_PY2CIFRW),yes)
PY2CIFRWURL = http://downloads.sf.net/cbflib/$(PY2CIFRW).tar.gz
PY2PLYURL = http://www.dabeaz.com/ply/$(PY2PLY).tar.gz
endif
ifneq ($(CBFLIB_DONT_USE_PY3CIFRW),yes)
PY3CIFRWURL = http://downloads.sf.net/cbflib/$(PY3CIFRW).tar.gz
PY3PLYURL = http://downloads.sf.net/cbflib/$(PY3PLY).tar.gz
endif
REGEX_URL ?= http://downloads.sf.net/cbflib/$(REGEX).tar.gz
TIFF_URL ?= http://downloads.sf.net/cbflib/$(TIFF).tar.gz
HDF5_URL ?= http://downloads.sf.net/cbflib/$(HDF5).tar.gz
ifneq ($(CBFLIB_DONT_USE_LOCAL_NUWEB),yes)
NUWEB_URL ?= http://downloads.sf.net/cbflib/$(NUWEB_DEP).tar.gz
endif
ifneq ($(MSYS2),yes)
LZ4_URL = http://downloads.sf.net/cbflib/$(LZ4).tar.gz
else
LZ4_URL = http://www.github.com/yayahjb/$(LZ4).git
endif
BSHUFURL = http://downloads.sf.net/cbflib/$(BSHUF).tar.gz
#
# Include directories
#
INCLUDES = -I$(INCLUDE) -I$(SRC) $(HDF5include)
#
# runtime library path export commands
#
ifeq ($(HDF5_PREFIX),)
RTLPEXPORTS = LD_LIBRARY_PATH=$(PWD)/solib:$(PWD)/lib;export LD_LIBRARY_PATH; DYLD_LIBRARY_PATH=$(PWD)/solib:$(PWD)/lib;export DYLD_LIBRARY_PATH; LD_RUN_PATH=$(PWD)/solib:$(PWD)/lib;export LD_RUN_PATH;
else
RTLPEXPORTS = LD_LIBRARY_PATH=$(PWD)/solib:$(PWD)/lib:$(HDF5_PREFIX)/lib;export LD_LIBRARY_PATH; DYLD_LIBRARY_PATH=$(PWD)/solib:$(PWD)/lib:$(HDF5_PREFIX)/lib;export DYLD_LIBRARY_PATH; LD_RUN_PATH=$(PWD)/solib:$(PWD)/lib:$(HDF5_PREFIX)/lib;export LD_RUN_PATH;
endif
######################################################################
# You should not need to make modifications below this line #
######################################################################
ifneq ($(CBF_USE_ULP),)
SRC_CBF_ULP_C = $(SRC)/cbf_ulp.c
INCLUDE_CBF_ULP_H = $(INCLUDE)/cbf_ulp.h
BIN_TESTULP = $(BIN)/testulp
else
SRC_CBF_ULP_C =
INCLUyDE_CBF_ULP_H =
BIN_TESTULP =
endif
ifneq ($(MSYS2),yes)
SRC_REALPATH =
else
SRC_REALPATH = $(SRC)/realpath.c
endif
#
# Suffixes of files to be used or built
#
.SUFFIXES: .c .o .f90 .m4
.m4.f90:
m4 -P $(M4FLAGS) $< > $@
ifneq ($(F90C),)
.f90.o:
$(F90C) $(F90FLAGS) -c $< -o $@
endif
#
# Common dependencies
#
COMMONDEP = $(M4)/Makefile.m4
#
# Source files
#
SOURCE = $(SRC)/cbf.c \
$(SRC)/cbf_airy_disk.c \
$(SRC)/cbf_alloc.c \
$(SRC)/cbf_ascii.c \
$(SRC)/cbf_binary.c \
$(SRC)/cbf_byte_offset.c \
$(SRC)/cbf_canonical.c \
$(SRC)/cbf_codes.c \
$(SRC)/cbf_compress.c \
$(SRC)/cbf_context.c \
$(SRC)/cbf_copy.c \
$(SRC)/cbf_file.c \
$(SRC)/cbf_getopt.c \
$(SRC)/cbf_hdf5.c \
$(SRC)/cbf_hdf5_filter.c \
$(SRC)/cbf_lex.c \
$(SRC)/cbf_minicbf_header.c\
$(SRC)/cbf_nibble_offset.c \
$(SRC)/cbf_packed.c \
$(SRC)/cbf_predictor.c \
$(SRC)/cbf_read_binary.c \
$(SRC)/cbf_read_mime.c \
$(SRC)/cbf_simple.c \
$(SRC)/cbf_string.c \
$(SRC)/cbf_stx.c \
$(SRC)/cbf_tree.c \
$(SRC_CBF_ULP_C) \
$(SRC)/cbf_uncompressed.c \
$(SRC)/cbf_write.c \
$(SRC)/cbf_write_binary.c \
$(SRC)/cbf_ws.c \
$(SRC)/cbff.c \
$(SRC)/md5c.c \
$(SRC)/img.c \
$(SRC_FGETLN) $(SRC_REALPATH)
ifneq ($(CBFLIB_DONT_USE_PY2CIFRW),yes)
PY2SOURCE = $(SRC)/drel_lex.py \
$(SRC)/drel_yacc.py \
$(SRC)/drelc.py \
$(SRC)/drel_prep.py
endif
ifneq ($(CBFLIB_DONT_USE_PY3CIFRW),yes)
PY3SOURCE = $(SRC)/drel_lex.py \
$(SRC)/drel_yacc.py \
$(SRC)/drelc.py \
$(SRC)/drel_prep.py
endif
F90SOURCE = $(SRC)/fcb_atol_wcnt.f90 \
$(SRC)/fcb_ci_strncmparr.f90 \
$(SRC)/fcb_exit_binary.f90 \
$(SRC)/fcb_nblen_array.f90 \
$(SRC)/fcb_next_binary.f90 \
$(SRC)/fcb_open_cifin.f90 \
$(SRC)/fcb_packed.f90 \
$(SRC)/fcb_read_bits.f90 \
$(SRC)/fcb_read_byte.f90 \
$(SRC)/fcb_read_image.f90 \
$(SRC)/fcb_read_line.f90 \
$(SRC)/fcb_read_xds_i2.f90 \
$(SRC)/fcb_skip_whitespace.f90
#
# Header files
#
HEADERS = $(INCLUDE)/cbf.h \
$(INCLUDE)/cbf_airy_disk.h \
$(INCLUDE)/cbf_alloc.h \
$(INCLUDE)/cbf_ascii.h \
$(INCLUDE)/cbf_binary.h \
$(INCLUDE)/cbf_byte_offset.h \
$(INCLUDE)/cbf_canonical.h \
$(INCLUDE)/cbf_codes.h \
$(INCLUDE)/cbf_compress.h \
$(INCLUDE)/cbf_context.h \
$(INCLUDE)/cbf_copy.h \
$(INCLUDE)/cbf_file.h \
$(INCLUDE)/cbf_getopt.h \
$(INCLUDE)/cbf_hdf5.h \
$(INCLUDE)/cbf_hdf5_filter.h \
$(INCLUDE)/cbf_lex.h \
$(INCLUDE)/cbf_minicbf_header.h\
$(INCLUDE)/cbf_nibble_offset.h \
$(INCLUDE)/cbf_packed.h \
$(INCLUDE)/cbf_predictor.h \
$(INCLUDE)/cbf_read_binary.h \
$(INCLUDE)/cbf_read_mime.h \
$(INCLUDE)/cbf_simple.h \
$(INCLUDE)/cbf_string.h \
$(INCLUDE)/cbf_stx.h \
$(INCLUDE)/cbf_tree.h \
$(INCLUDE)/cbf_uncompressed.h \
$(INCLUDE_CBF_ULP_H) \
$(INCLUDE)/cbf_write.h \
$(INCLUDE)/cbf_write_binary.h \
$(INCLUDE)/cbf_ws.h \
$(INCLUDE)/global.h \
$(INCLUDE)/cbff.h \
$(INCLUDE)/md5.h \
$(INCLUDE)/img.h
#
# m4 macro files
#
M4FILES = $(M4)/fcblib_defines.m4 \
$(M4)/fcb_exit_binary.m4 \
$(M4)/fcb_next_binary.m4 \
$(M4)/fcb_open_cifin.m4 \
$(M4)/fcb_packed.m4 \
$(M4)/fcb_read_bits.m4 \
$(M4)/fcb_read_image.m4 \
$(M4)/fcb_read_xds_i2.m4 \
$(M4)/test_fcb_read_image.m4 \
$(M4)/test_xds_binary.m4
#
# Documentation files
#
DOCUMENTS = $(DOC)/CBFlib.html \
$(DOC)/CBFlib.txt \
$(DOC)/CBFlib_NOTICES.html \
$(DOC)/CBFlib_NOTICES.txt \
$(DOC)/ChangeLog \
$(DOC)/ChangeLog.html \
$(DOC)/MANIFES \
$(DOC)/gpl.txt $(DOC)/lgpl.txt
#
# HTML Graphics files
#
JPEGS = $(GRAPHICS)/CBFbackground.jpg \
$(GRAPHICS)/CBFbig.jpg \
$(GRAPHICS)/CBFbutton.jpg \
$(GRAPHICS)/cbflibbackground.jpg\
$(GRAPHICS)/cbflibbig.jpg \
$(GRAPHICS)/cbflibbutton.jpg \
$(GRAPHICS)/cifhome.jpg \
$(GRAPHICS)/iucrhome.jpg \
$(GRAPHICS)/noticeButton.jpg
#
# Default: instructions
#
default:
@echo ' '
@echo '***************************************************************'
@echo ' '
@echo ' PLEASE READ README and doc/CBFlib_NOTICES.txt'
@echo ' '
@echo ' Before making the CBF library and example programs, check'
@echo ' that the C compiler name and flags are correct:'
@echo ' '
@echo ' The current values are:'
@echo ' '
@echo ' $(CC) $(CFLAGS) $(MISCFLAG) $(CBF_REGEXFLAG) $(PYCIFRWFLAG)'
@echo ' '
@echo ' If you have changed any of the nuweb .w input files, you will need'
@echo ' need nuweb installed, check that CBFLIB_DONT_USE_LOCAL_NUWEB,'
@echo ' and NUWEB are defined correctly :'
@echo ' '
@echo ' The current values are:'
@echo ' '
@echo ' CBFLIB_DONT_USE_LOCAL_NUWEB = $(CBFLIB_DONT_USE_LOCAL_NUWEB)'
@echo ' NUWEB = $(NUWEB)'
@echo ' NUWEB_DEP = $(NUWEB_DEP)'
@echo ' NUWEB_DEP2 = $(NUWEB_DEP2)'
@echo ' '
@echo ' You will need either a system HDF5 1.12 or it to be installed here.'
@echo ' Check that CBFLIB_DONT_USE_LOCAL_HDF5 and HDF5 are defined correctly :'
@echo ' '
@echo ' The current values are:'
@echo ' '
@echo ' CBFLIB_DONT_USE_LOCAL_HDF5 = $(CBFLIB_DONT_USE_LOCAL_HDF5)'
@echo ' HDF5 = $(HDF5)'
@echo ' HDF5_PREFIX = $(HDF5_PREFIX)'
@echo ' '
@echo ' Before installing the CBF library and example programs, check'
@echo ' that the install directory is correct:'
@echo ' '
@echo ' The current value :'
@echo ' '
@echo ' $(CBF_PREFIX) '
@echo ' '
@echo ' To compile the CBF library and example programs type:'
@echo ' '
@echo ' make clean'
@echo ' make all'
@echo ' '
@echo ' To compile the CBF library as a shared object library, type:'
@echo ' '
@echo ' make shared'
@echo ' '
@echo ' To compile the Java wrapper classes for CBF library, type:'
@echo ' '
@echo ' make javawrapper'
@echo ' '
@echo ' To run a set of tests type:'
@echo ' '
@echo ' make tests'
@echo ' '
@echo ' To run some java tests type:'
@echo ' '
@echo ' make javatests'
@echo ' '
@echo ' The tests assume that several data files are in the directories'
@echo ' $(DATADIRI) and $(DATADIRO)'
@echo ' '
@echo ' These directory can be obtained from'
@echo ' '
@echo ' $(DATAURLI) '
@echo ' $(DATAURLO) '
@echo ' '
@echo ' To clean up the directories type:'
@echo ' '
@echo ' make clean'
@echo ' '
@echo ' To install the library and binaries type:'
@echo ' '
@echo ' make install'
@echo ' '
@echo '***************************************************************'
@echo ' '
#
# Compile the library and examples
#