-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathMakefile
More file actions
2154 lines (1754 loc) · 100 KB
/
Makefile
File metadata and controls
2154 lines (1754 loc) · 100 KB
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
### User customizations
# Put user-specific changes in your own Makefile.user file in this directory.
# Make will silently continue if Makefile.user does not exist.
-include Makefile.user
# Don't let the user override this; it should refer to the current directory.
DAIKONDIR := $(realpath $(dir $(lastword ${MAKEFILE_LIST}))..)
DAIKONSCRIPTS ?= ${DAIKONDIR}/scripts
PLUMESCRIPTS ?= ${DAIKONDIR}/.plume-scripts
HTMLTOOLS ?= ${DAIKONDIR}/utils/html-tools
USER ?= daikonbuild
JAVA ?= java -ea
# For debugging, add -verbose flag to javac command
# JAVAC ?= javac -g -Xlint:unchecked
JAVAC ?= javac
JAVADOC ?= javadoc
JAR ?= jar
BuildJDKTool = BuildJDK
# The "JAVANN" variables mean "at least version NN", except JAVA8.
JAVA_VERSION_STRING_WITH_EA := $(shell javac -version 2>&1 | head -1 | cut "-d " -f2)
JAVA_VERSION_STRING := $(shell javac -version 2>&1 | head -1 | cut "-d " -f2 | sed 's/-ea//')
ifneq (,$(findstring start1.8,start${JAVA_VERSION_STRING}))
JAVA8 := 1
JAVA17 := 0
JAVA21 := 0
JAVA24 := 0
JAVA25 := 0
JAVA_RELEASE_NUMBER := 8
else
JAVA8 := 0
JAVA17 := 0
JAVA21 := 0
JAVA24 := 0
JAVA25 := 0
JAVA_RELEASE_NUMBER := $(shell echo ${JAVA_VERSION_STRING} | sed 's/\([0-9]*\)\..*/\1/')
endif
ifeq ($(shell test ${JAVA_RELEASE_NUMBER} -ge 17; echo $$?),0)
JAVA17 := 1
endif
ifeq ($(shell test ${JAVA_RELEASE_NUMBER} -ge 21; echo $$?),0)
JAVA21 := 1
endif
# Temporary, since Java 24 is not a LTS release.
ifeq ($(shell test ${JAVA_RELEASE_NUMBER} -ge 24; echo $$?),0)
JAVA24 := 1
BuildJDKTool = BuildJDK24
endif
ifeq ($(shell test ${JAVA_RELEASE_NUMBER} -ge 25; echo $$?),0)
JAVA25 := 1
endif
ifeq ($(shell test ${JAVA_RELEASE_NUMBER} -eq 25; echo $$?),0)
ifndef JAVA25_HOME
JAVA25_HOME := ${JAVA_HOME}
endif
endif
ifeq ($(shell test ${JAVA_RELEASE_NUMBER} -gt 20; echo $$?),0)
LINT_THIS_ESCAPE=-Xlint:-this-escape
endif
OS_ID := $(shell sed -n -e 's/^NAME="\(.*\)"/\1/p' /etc/os-release)
OS_REL := $(shell sed -n -e 's/^VERSION_ID="\(.*\)"/\1/p' /etc/os-release)
# Users can set JAVAC_TARGET_FLAGS, taking precedence over these settings.
# Use "--source 25 --target 25" because Java 25 is an LTS version.
ifeq (${JAVA25}, 1)
ifndef JAVA25_HOME
$(error JAVA25_HOME is not set)
endif
JAVAC_TARGET_FLAGS ?= --source 25 --target 25 --system ${JAVA25_HOME}
else ifeq (${JAVA24}, 1)
JAVAC_TARGET_FLAGS ?= -source 24 -target 24
else
JAVAC_TARGET_FLAGS ?= -source 8 -target 8
endif
# TODO: -Werror is temporary.
JAVAC_ARGS ?= -g -XDignore.symbol.file -Xmaxerrs 100000 -Xmaxwarns 100000 -Werror -Xlint:-path -Xlint:-options -Xlint:-classfile ${LINT_THIS_ESCAPE} ${JAVAC_TARGET_ARGS} ${JAVAC_TARGET_FLAGS}
INSTALL ?= /usr/bin/install
# By default, if environment variable CHECKERFRAMEWORK is set, that Checker Framework is used.
# To force use of the Checker Framework in java/lib/, run like this:
# make NO_LOCAL_CHECKERFRAMEWORK=true typecheck-nullness
ifndef NO_LOCAL_CHECKERFRAMEWORK
ifdef CHECKERFRAMEWORK
ifneq ("$(wildcard ${CHECKERFRAMEWORK})","")
CHECKERFRAMEWORK_JAR_DIR ?= ${CHECKERFRAMEWORK}/checker/dist
endif
endif
endif
CHECKERFRAMEWORK_JAR_DIR ?= ${DAIKONDIR}/java/lib/checker-framework
CHECKERFRAMEWORK_JAR ?= ${CHECKERFRAMEWORK_JAR_DIR}/checker.jar
CHECKERFRAMEWORK_JAVAC ?= ${CHECKERFRAMEWORK_JAR_DIR}/javac.jar
### end of user customizations
# Not := because DAIKON_CLASSPATH is set later in this file.
JAVADOC_COMMAND = ${JAVADOC} -cp ${DAIKON_CLASSPATH}
JAVAC_COMMAND = ${JAVAC} -cp ${DAIKON_CLASSPATH} -Xlint -J-Xmx7g ${JAVAC_ARGS}
JAVA_COMMAND = ${JAVA} -cp ${DAIKON_CLASSPATH}
###########################################################################
### Variables
###
## Classpath
## Daikon compiled files
ifeq "$(wildcard ${DAIKONDIR}/java/lib/daikon-plumelib.jar)" "${DAIKONDIR}/java/lib/daikon-plumelib.jar"
# Add jar files that only exist for the development version, not the
# distributed version, of Daikon. The if clause avoids a (harmless but
# annoying) javac error message that they don't exist.
# This classpath is a problem, because CHECKERFRAMEWORK_JAR may have
# a different version of a plume-lib library than java/lib/* does.
# One (unclean) approach is to update them simultaneously. Does that even work?
DAIKON_CLASSPATH := ${CHECKERFRAMEWORK_JAR}:${DAIKONDIR}/java/lib/*:${DAIKONDIR}/java
else
DAIKON_CLASSPATH := ${DAIKONDIR}/java
endif
## Add tools.jar and rt.jar, if they exist
ifeq ($(shell uname), Darwin)
JAVA_HOME ?= $(/usr/libexec/java_home)
else
ifeq ($(shell which javac > /dev/null 2>&1 && echo found || echo nonexistent), found)
JAVA_HOME ?= $(shell readlink -f $(shell which javac) | sed "s:/bin/javac::")
else
$(info Failure: Here is the output of: which javac)
$(info $(shell which javac))
$(error 'which javac' had exit status 1)
endif
endif
ifneq "$(wildcard ${JAVA_HOME}/lib/tools.jar)" ""
DAIKON_CLASSPATH := ${DAIKON_CLASSPATH}:${JAVA_HOME}/lib/tools.jar
endif
ifneq "$(wildcard ${JAVA_HOME}/jre/lib/rt.jar)" ""
DAIKON_CLASSPATH := ${DAIKON_CLASSPATH}:${JAVA_HOME}/jre/lib/rt.jar
endif
DOCLETPATH := ${DAIKONDIR}/java:$(wildcard ${DAIKONDIR}/java/lib/bcel-util-*.jar):$(wildcard ${DAIKONDIR}/java/lib/plume-util-*.jar):$(wildcard ${DAIKONDIR}/java/lib/reflection-util-*.jar):$(wildcard ${DAIKONDIR}/java/lib/hashmap-util-*.jar):${DAIKONDIR}/java/lib/daikon-plumelib.jar
DOCLET_FLAGS :=
LINKOFFLINE := https://docs.oracle.com/javase/8/docs/api/
ifeq ($(shell expr ${JAVA_RELEASE_NUMBER} \>= 11),1)
DOCLET_FLAGS := --add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
LINKOFFLINE := https://docs.oracle.com/en/java/javase/17/docs/api/
endif
# This command should run after the AUTO_GENERATED_FILES are generated, or
# else AUTO_GENERATED_FILES should be appended to it (without duplication).
# Therefore, this assignment uses "=" instead of ":=".
# DO NOT USE THESE in dependencies or the
# find command will get run multiple times. USE AUTO_GENERATED_FILES instead.
# "-o -path './jakarta-oro*/src/java/examples'" does not work for non-GNU find.
# " | perl -pi -e 's/^\.\///g'" to remove leading "./"
SORT_DIRECTORY_ORDER = ${PLUMESCRIPTS}/sort-directory-order
ifneq "$(wildcard ${SORT_DIRECTORY_ORDER})" "${SORT_DIRECTORY_ORDER}"
# Until "make ../plume-scripts" has been run, sort-directory-order is not available.
SORT_DIRECTORY_ORDER = sort
endif
DAIKON_JAVA_FILES := $(shell find daikon/ -name '*.java' -not -name '*\#*' -print | ${SORT_DIRECTORY_ORDER})
ifeq (${JAVA24}, 0)
DAIKON_JAVA_FILES := $(filter-out %24.java, ${DAIKON_JAVA_FILES})
endif
JAVA_FILES := $(shell find . -follow \( -name '*daikon-java*' -o -name '*daikon-instrumented*' -o -name 'PrototypeChecker.java' -o -name 'VIndexChecker.java' -o -name 'VIndexAnnotatedTypeFactory.java' -o -name 'ReturnBytecodes.java' -o -name 'SplitterFactoryTest.java' -o -name '\.\#*' \) -prune -o -name '*.java' -print | grep -v '/jakarta-oro.*/src/java/examples/' | ${SORT_DIRECTORY_ORDER})
ifeq (${JAVA24}, 0)
JAVA_FILES := $(filter-out %24.java, ${JAVA_FILES})
endif
JAVA_FILES_FOR_STYLE := $(shell find . -follow \( -name '*daikon-java*' -o -name '*daikon-instrumented*' -o -name 'PrototypeChecker.java' -o -name 'VIndexChecker.java' -o -name 'VIndexAnnotatedTypeFactory.java' -o -name 'ReturnBytecodes.java' -o -name 'SplitterFactoryTest.java' -o -name 'WeakHasherMap.java' -o -name 'WeakIdentityHashMap.java' -o -name '\.\#*' -o -path './jtb' -o -path './daikon/dcomp-transfer' \) -prune -o -name '*.java' -print | grep -v '/jakarta-oro.*/src/java/examples/' | ${SORT_DIRECTORY_ORDER})
ifeq (${JAVA24}, 0)
JAVA_FILES_FOR_STYLE := $(filter-out %24.java, ${JAVA_FILES_FOR_STYLE})
endif
# Other find commands should perhaps use the recursive grep form instead
JAVA_FILES_FOR_FORMAT := $(shell grep -r --include '*.java' --exclude-dir '*daikon-java*' --exclude-dir '*daikon-instrumented*' --exclude WeakHasherMap.java --exclude WeakIdentityHashMap.java --exclude InvariantDoclet.java --exclude ParameterDoclet.java -L 'This file is automatically generated' . | grep -v "^./jtb" | ${SORT_DIRECTORY_ORDER})
ifeq (${JAVA24}, 0)
JAVA_FILES_FOR_FORMAT := $(filter-out %24.java, ${JAVA_FILES_FOR_FORMAT})
endif
# Don't exclude the whole ./daikon/test directory.
TAG_FILES := $(shell find . -type f -follow \( -name '*daikon-java*' -o -name '*Test.java' -o -name '*Tester.java' -o -name 'Test*.java' -o -name 'GenericTestClass.java' -o -name 'TestQuant.java' -o -name 'DiffDummyInvariant.java' -o -name 'AllTestsSuite.java' \) -prune -o \( -name '*.java' -o -name '*.java.jpp' \) -print | grep -v '/\.\#' | ${SORT_DIRECTORY_ORDER})
TAG_FILES_NO_JTB := $(shell find . -type f -follow \( -name '*daikon-java*' -o -name '*Test.java' -o -name '*Tester.java' -o -name 'Test*.java' -o -name 'GenericTestClass.java' -o -name 'TestQuant.java' -o -name 'DiffDummyInvariant.java' -o -name 'AllTestsSuite.java' \) -prune -o \( -path './jtb' \) -prune -o \( -name '*.java' -o -name '*.java.jpp' \) -print | grep -v '/\.\#' | ${SORT_DIRECTORY_ORDER})
# When removing files from this list, add them to OLD_AUTO_GENERATED_FILES.
AUTO_GENERATED_FILES = \
daikon/PptSlice1.java \
daikon/PptSlice2.java \
daikon/PptSlice3.java \
daikon/Quant.java \
daikon/inv/ternary/threeScalar/FunctionBinary.java \
daikon/inv/ternary/threeScalar/FunctionBinaryFloat.java \
daikon/inv/ternary/threeScalar/ThreeScalar.java \
daikon/inv/ternary/threeScalar/ThreeFloat.java \
daikon/inv/ternary/threeScalar/LinearTernaryCore.java \
daikon/inv/ternary/threeScalar/LinearTernaryCoreFloat.java \
daikon/inv/ternary/threeScalar/LinearTernary.java \
daikon/inv/ternary/threeScalar/LinearTernaryFloat.java \
daikon/inv/unary/LowerBoundCore.java \
daikon/inv/unary/UpperBoundCore.java \
daikon/inv/unary/LowerBoundCoreFloat.java \
daikon/inv/unary/UpperBoundCoreFloat.java \
daikon/inv/unary/scalar/LowerBound.java \
daikon/inv/unary/scalar/UpperBound.java \
daikon/inv/unary/scalar/LowerBoundFloat.java \
daikon/inv/unary/scalar/UpperBoundFloat.java \
daikon/inv/unary/scalar/OneOfScalar.java \
daikon/inv/unary/scalar/OneOfFloat.java \
daikon/inv/unary/string/OneOfString.java \
daikon/inv/unary/scalar/NonZero.java \
daikon/inv/unary/scalar/NonZeroFloat.java \
daikon/inv/unary/scalar/RangeInt.java \
daikon/inv/unary/scalar/RangeFloat.java \
daikon/inv/unary/sequence/EltRangeInt.java \
daikon/inv/unary/sequence/EltRangeFloat.java \
daikon/inv/unary/sequence/OneOfSequence.java \
daikon/inv/unary/sequence/OneOfFloatSequence.java \
daikon/inv/unary/sequence/EltOneOf.java \
daikon/inv/unary/sequence/EltOneOfFloat.java \
daikon/inv/unary/sequence/EltLowerBound.java \
daikon/inv/unary/sequence/EltLowerBoundFloat.java \
daikon/inv/unary/sequence/EltUpperBound.java \
daikon/inv/unary/sequence/EltUpperBoundFloat.java \
daikon/inv/unary/sequence/NoDuplicates.java \
daikon/inv/unary/sequence/NoDuplicatesFloat.java \
daikon/inv/unary/sequence/SeqIndexIntEqual.java \
daikon/inv/unary/sequence/SeqIndexIntNonEqual.java \
daikon/inv/unary/sequence/SeqIndexIntGreaterThan.java \
daikon/inv/unary/sequence/SeqIndexIntGreaterEqual.java \
daikon/inv/unary/sequence/SeqIndexIntLessThan.java \
daikon/inv/unary/sequence/SeqIndexIntLessEqual.java \
daikon/inv/unary/sequence/SeqIndexFloatEqual.java \
daikon/inv/unary/sequence/SeqIndexFloatNonEqual.java \
daikon/inv/unary/sequence/SeqIndexFloatGreaterThan.java \
daikon/inv/unary/sequence/SeqIndexFloatGreaterEqual.java \
daikon/inv/unary/sequence/SeqIndexFloatLessThan.java \
daikon/inv/unary/sequence/SeqIndexFloatLessEqual.java \
daikon/inv/unary/sequence/CommonSequence.java \
daikon/inv/unary/sequence/CommonFloatSequence.java \
daikon/inv/unary/sequence/EltNonZero.java \
daikon/inv/unary/sequence/EltNonZeroFloat.java \
daikon/inv/unary/sequence/EltwiseIntComparison.java \
daikon/inv/unary/sequence/EltwiseFloatComparison.java \
daikon/inv/unary/sequence/EltwiseIntEqual.java \
daikon/inv/unary/sequence/EltwiseIntLessThan.java \
daikon/inv/unary/sequence/EltwiseIntLessEqual.java \
daikon/inv/unary/sequence/EltwiseIntGreaterThan.java \
daikon/inv/unary/sequence/EltwiseIntGreaterEqual.java \
daikon/inv/unary/sequence/EltwiseFloatEqual.java \
daikon/inv/unary/sequence/EltwiseFloatLessThan.java \
daikon/inv/unary/sequence/EltwiseFloatLessEqual.java \
daikon/inv/unary/sequence/EltwiseFloatGreaterThan.java \
daikon/inv/unary/sequence/EltwiseFloatGreaterEqual.java \
daikon/inv/unary/stringsequence/EltOneOfString.java \
daikon/inv/unary/stringsequence/OneOfStringSequence.java \
daikon/inv/binary/sequenceScalar/Member.java \
daikon/inv/binary/sequenceString/MemberString.java \
daikon/inv/binary/sequenceString/SequenceString.java \
daikon/inv/binary/sequenceScalar/MemberFloat.java \
daikon/inv/binary/sequenceScalar/SeqIntLessThan.java \
daikon/inv/binary/sequenceScalar/SeqIntGreaterThan.java \
daikon/inv/binary/sequenceScalar/SeqIntLessEqual.java \
daikon/inv/binary/sequenceScalar/SeqIntGreaterEqual.java\
daikon/inv/binary/sequenceScalar/SeqIntEqual.java \
daikon/inv/binary/sequenceScalar/SeqFloatLessThan.java \
daikon/inv/binary/sequenceScalar/SeqFloatGreaterThan.java \
daikon/inv/binary/sequenceScalar/SeqFloatLessEqual.java \
daikon/inv/binary/sequenceScalar/SeqFloatGreaterEqual.java \
daikon/inv/binary/sequenceScalar/SeqFloatEqual.java \
daikon/inv/binary/sequenceScalar/SequenceScalar.java \
daikon/inv/binary/sequenceScalar/SequenceFloat.java \
daikon/inv/binary/twoScalar/IntEqual.java \
daikon/inv/binary/twoScalar/FloatEqual.java \
daikon/inv/binary/twoScalar/IntNonEqual.java \
daikon/inv/binary/twoScalar/FloatNonEqual.java \
daikon/inv/binary/twoScalar/IntLessThan.java \
daikon/inv/binary/twoScalar/FloatLessThan.java \
daikon/inv/binary/twoScalar/IntLessEqual.java \
daikon/inv/binary/twoScalar/FloatLessEqual.java \
daikon/inv/binary/twoScalar/IntGreaterThan.java \
daikon/inv/binary/twoScalar/FloatGreaterThan.java \
daikon/inv/binary/twoScalar/IntGreaterEqual.java \
daikon/inv/binary/twoScalar/FloatGreaterEqual.java \
daikon/inv/binary/twoScalar/NumericInt.java \
daikon/inv/binary/twoScalar/NumericFloat.java \
daikon/inv/binary/twoString/StdString.java \
daikon/inv/binary/twoScalar/LinearBinaryCore.java \
daikon/inv/binary/twoScalar/LinearBinaryCoreFloat.java \
daikon/inv/binary/twoScalar/LinearBinary.java \
daikon/inv/binary/twoScalar/LinearBinaryFloat.java \
daikon/inv/binary/twoScalar/TwoScalar.java \
daikon/inv/binary/twoScalar/TwoFloat.java \
daikon/inv/binary/twoString/TwoString.java \
daikon/inv/binary/twoString/StringEqual.java \
daikon/inv/binary/twoString/StringNonEqual.java \
daikon/inv/binary/twoString/StringLessThan.java \
daikon/inv/binary/twoString/StringLessEqual.java \
daikon/inv/binary/twoString/StringGreaterThan.java \
daikon/inv/binary/twoString/StringGreaterEqual.java \
daikon/inv/binary/twoSequence/SeqSeqIntEqual.java \
daikon/inv/binary/twoSequence/SeqSeqIntLessThan.java \
daikon/inv/binary/twoSequence/SeqSeqIntGreaterThan.java \
daikon/inv/binary/twoSequence/SeqSeqIntLessEqual.java \
daikon/inv/binary/twoSequence/SeqSeqIntGreaterEqual.java \
daikon/inv/binary/twoSequence/SeqSeqFloatEqual.java \
daikon/inv/binary/twoSequence/SeqSeqFloatLessThan.java \
daikon/inv/binary/twoSequence/SeqSeqFloatGreaterThan.java \
daikon/inv/binary/twoSequence/SeqSeqFloatLessEqual.java \
daikon/inv/binary/twoSequence/SeqSeqFloatGreaterEqual.java \
daikon/inv/binary/twoSequence/SeqSeqStringEqual.java \
daikon/inv/binary/twoSequence/SeqSeqStringLessThan.java \
daikon/inv/binary/twoSequence/SeqSeqStringGreaterThan.java \
daikon/inv/binary/twoSequence/SeqSeqStringLessEqual.java \
daikon/inv/binary/twoSequence/SeqSeqStringGreaterEqual.java \
daikon/inv/binary/twoSequence/Reverse.java \
daikon/inv/binary/twoSequence/ReverseFloat.java \
daikon/inv/binary/twoSequence/SubSequence.java \
daikon/inv/binary/twoSequence/SubSequenceFloat.java \
daikon/inv/binary/twoSequence/SuperSequence.java \
daikon/inv/binary/twoSequence/SuperSequenceFloat.java \
daikon/inv/binary/twoSequence/SubSet.java \
daikon/inv/binary/twoSequence/SubSetFloat.java \
daikon/inv/binary/twoSequence/SuperSet.java \
daikon/inv/binary/twoSequence/SuperSetFloat.java \
daikon/inv/binary/twoSequence/PairwiseIntEqual.java \
daikon/inv/binary/twoSequence/PairwiseIntLessThan.java \
daikon/inv/binary/twoSequence/PairwiseIntGreaterThan.java \
daikon/inv/binary/twoSequence/PairwiseIntLessEqual.java \
daikon/inv/binary/twoSequence/PairwiseIntGreaterEqual.java \
daikon/inv/binary/twoSequence/PairwiseFloatEqual.java \
daikon/inv/binary/twoSequence/PairwiseFloatLessThan.java \
daikon/inv/binary/twoSequence/PairwiseFloatGreaterThan.java \
daikon/inv/binary/twoSequence/PairwiseFloatLessEqual.java \
daikon/inv/binary/twoSequence/PairwiseFloatGreaterEqual.java \
daikon/inv/binary/twoSequence/PairwiseLinearBinary.java \
daikon/inv/binary/twoSequence/PairwiseLinearBinaryFloat.java \
daikon/inv/binary/twoSequence/PairwiseStringEqual.java \
daikon/inv/binary/twoSequence/PairwiseStringLessThan.java \
daikon/inv/binary/twoSequence/PairwiseStringGreaterThan.java \
daikon/inv/binary/twoSequence/PairwiseStringLessEqual.java \
daikon/inv/binary/twoSequence/PairwiseStringGreaterEqual.java \
daikon/inv/binary/twoSequence/PairwiseLinearBinary.java \
daikon/inv/binary/twoSequence/PairwiseLinearBinaryFloat.java \
daikon/inv/binary/twoSequence/PairwiseNumericInt.java \
daikon/inv/binary/twoSequence/PairwiseNumericFloat.java \
daikon/inv/binary/twoSequence/PairwiseString.java \
daikon/inv/binary/twoSequence/TwoSequence.java \
daikon/inv/binary/twoSequence/TwoSequenceFloat.java \
daikon/inv/binary/twoSequence/TwoSequenceString.java \
daikon/inv/binary/twoSequence/TwoSequenceString.java \
daikon/derive/ternary/SequenceScalarArbitrarySubsequence.java \
daikon/derive/ternary/SequenceFloatArbitrarySubsequence.java \
daikon/derive/ternary/SequenceStringArbitrarySubsequence.java \
daikon/derive/ternary/SequenceScalarArbitrarySubsequenceFactory.java \
daikon/derive/ternary/SequenceFloatArbitrarySubsequenceFactory.java \
daikon/derive/ternary/SequenceStringArbitrarySubsequenceFactory.java \
daikon/derive/binary/SequenceScalarSubscript.java \
daikon/derive/binary/SequenceFloatSubscript.java \
daikon/derive/binary/SequenceStringSubscript.java \
daikon/derive/binary/SequenceScalarSubsequence.java \
daikon/derive/binary/SequenceFloatSubsequence.java \
daikon/derive/binary/SequenceStringSubsequence.java \
daikon/derive/binary/SequenceScalarSubscriptFactory.java \
daikon/derive/binary/SequenceFloatSubscriptFactory.java \
daikon/derive/binary/SequenceStringSubscriptFactory.java \
daikon/derive/binary/SequenceScalarIntersection.java \
daikon/derive/binary/SequenceFloatIntersection.java \
daikon/derive/binary/SequenceStringIntersection.java \
daikon/derive/binary/SequenceScalarIntersectionFactory.java \
daikon/derive/binary/SequenceFloatIntersectionFactory.java \
daikon/derive/binary/SequenceStringIntersectionFactory.java \
daikon/derive/binary/SequenceScalarUnion.java \
daikon/derive/binary/SequenceFloatUnion.java \
daikon/derive/binary/SequenceStringUnion.java \
daikon/derive/binary/SequenceScalarUnionFactory.java \
daikon/derive/binary/SequenceFloatUnionFactory.java \
daikon/derive/binary/SequenceStringUnionFactory.java \
daikon/derive/binary/SequencesPredicate.java \
daikon/derive/binary/SequencesPredicateFloat.java \
daikon/derive/binary/SequencesPredicateFactory.java \
daikon/derive/binary/SequencesPredicateFactoryFloat.java \
daikon/derive/binary/SequencesJoin.java \
daikon/derive/binary/SequencesJoinFloat.java \
daikon/derive/binary/SequencesJoinFactory.java \
daikon/derive/binary/SequencesJoinFactoryFloat.java \
daikon/derive/unary/SequenceInitial.java \
daikon/derive/unary/SequenceInitialFloat.java \
daikon/derive/unary/SequenceInitialFactory.java \
daikon/derive/unary/SequenceInitialFactoryFloat.java \
daikon/config/InvariantDoclet.java \
daikon/config/ParameterDoclet.java \
# These files were auto-generated previously; they still might exist in
# some user's directory.
OLD_AUTO_GENERATED_FILES = \
daikon/inv/binary/twoScalar/FloatComparisonCore.java \
daikon/inv/binary/twoScalar/FunctionUnary.java \
daikon/inv/binary/twoScalar/FunctionUnaryCore.java \
daikon/inv/binary/twoScalar/FunctionUnaryCoreFloat.java \
daikon/inv/binary/twoScalar/FunctionUnaryFloat.java \
daikon/inv/binary/twoScalar/IntComparisonCore.java \
daikon/inv/binary/twoSequence/PairwiseFunctionUnary.java \
daikon/inv/binary/twoSequence/PairwiseFunctionUnaryFloat.java \
daikon/inv/unary/sequence/SeqIndexComparison.java \
daikon/inv/unary/sequence/SeqIndexComparisonFloat.java \
daikon/inv/unary/sequence/SeqIndexNonEqual.java \
daikon/inv/unary/sequence/SeqIndexNonEqualFloat.java \
daikon/inv/binary/twoScalar/NonEqualCore.java \
daikon/inv/binary/twoScalar/NonEqualCoreFloat.java \
daikon/inv/binary/sequenceScalar/SequenceScalarFactory.java \
daikon/inv/binary/sequenceScalar/SequenceFloatFactory.java \
daikon/inv/binary/twoScalar/TwoScalarFactory.java \
daikon/inv/binary/twoScalar/TwoFloatFactory.java \
daikon/inv/binary/twoSequence/TwoSequenceFactory.java \
daikon/inv/binary/twoSequence/TwoSequenceFactoryFloat.java \
daikon/inv/unary/sequence/SingleScalarSequenceFactory.java \
daikon/inv/unary/sequence/SingleFloatSequenceFactory.java \
daikon/inv/ternary/threeScalar/ThreeScalarFactory.java \
daikon/inv/binary/sequenceString/Member.java \
daikon/inv/ternary/threeScalar/FunctionBinaryCore.java \
daikon/inv/Functions.java \
daikon/inv/FunctionsFloat.java \
daikon/inv/ternary/threeScalar/FunctionBinaryCoreFloat.java \
utilMDE/MathMDE.java \
lib/utilMDE.jar
OLD_AUTO_GENERATED_CLASSES = $(subst .java,.class,${OLD_AUTO_GENERATED_FILES})
# These files cannot be generated until everything else has been compiled.
# (But, a problem is that it can get out of date and cause the compilation
# to fail during pass 1.)
AUTO_GENERATED_FILES_2 = \
daikon/test/split/SplitterFactoryTest.java
AUTO_GENERATED_CLASSES_2 = $(subst .java,.class,${AUTO_GENERATED_FILES_2})
# Used as a prerequisite, not for the file names, so OK to include update-libs.
ALL_GENERATED_FILES = update-libs ${AUTO_GENERATED_FILES} ${AUTO_GENERATED_FILES_2}
update-libs:
make -C .. update-libs
.PHONY: update-libs
###########################################################################
### Variables passed down to subshells
###
export DAIKON_CLASSPATH
export CHECKERJAR
export DAIKONDIR
###########################################################################
### Compilation targets
###
# all_directly is not marked as phony
.PHONY: default compile all all_stop_on_error all_via_daikon
default: all
compile: all
# "-S" means do not continue after errors.
all: all_stop_on_error
# Don't bother to run the unit tests if the compilation failed.
all_stop_on_error:
# if ../.git does not exist, then directory was created from
# a daikon archive file and we cannot do git-hooks
ifneq ($(shell ls ../.git 2>/dev/null),)
${MAKE} -C .. git-hooks
endif
${MAKE} --stop all_directly
${MAKE} junit
## In general, don't use this; it misses some files
all_via_daikon: chicory daikon/Daikon.class daikon/diff/Diff.class
${MAKE} all_pass2
xlint: chicory ${ALL_GENERATED_FILES}
@${JAVAC_COMMAND} -Xlint -Xmaxwarns 1000 ${DAIKON_JAVA_FILES} 2>&1
## ${JAVA_FILES} is so long I can't see the result on the same screen as the command.
# Do not mark this target as .PHONY. We want it to
# always recompile, whether recompilation is necessary or not. (Why?)
all_directly: ../utils/plume-scripts ${AUTO_GENERATED_FILES} java_files.txt
# # If SplitterFactoryTestUpdater.java is newer than SplitterFactoryTest.java, then delete the latter.
# if [ daikon/test/split/SplitterFactoryTestUpdater.java -nt daikon/test/split/SplitterFactoryTest.java ] ; then rm -f daikon/test/split/SplitterFactoryTest.java; fi
# remove 'bin' and 'orig' after versions stablize
rm -f `find daikon -path "*/debug*/bin" -prune -o -path "*/debug*/orig" -prune -o -path "*/debug*/instrumented" -prune -o -path "*/debug*/uninstrumented" -prune -o -name "*.class" -print`
@echo "CLASSPATH = ${CLASSPATH}"
@echo "DAIKON_CLASSPATH = ${DAIKON_CLASSPATH}"
@echo "JAVA_RELEASE_NUMBER = ${JAVA_RELEASE_NUMBER}"
@echo "JAVA_VERSION_STRING_WITH_EA = ${JAVA_VERSION_STRING_WITH_EA}"
${JAVAC_COMMAND} @java_files.txt
rm -f java_files.txt
# Post JDK 21, additional restrictions have been introduced that prevent developers
# from explicitly creating or modifying classes in the java.lang package (or any
# package in java.base) at compile time. However, runtime class redefinition with
# Instrumentation.redefineClasses() still works, so we declare the package to be
# "jaxa.lang" instead of "java.lang" and then use sed to edit the classfile after
# compilation back to "java.lang".
@if test -e ${DAIKONDIR}/java/daikon/dcomp-transfer/DCRuntime.class; then \
echo sed -e's/jaxa/java/g' -i -b ${DAIKONDIR}/java/daikon/dcomp-transfer/DCRuntime.class; \
sed -e's/jaxa/java/g' -i -b ${DAIKONDIR}/java/daikon/dcomp-transfer/DCRuntime.class; \
else \
echo sed -e's/jaxa/java/g' -i -b ${DAIKONDIR}/java/daikon/dcomp-dummy/DCRuntime.class; \
sed -e's/jaxa/java/g' -i -b ${DAIKONDIR}/java/daikon/dcomp-dummy/DCRuntime.class; \
fi;
# on some systems chmod with symbolic arguments pays attention to umask. so use 444 instead of -w
@chmod 444 ${AUTO_GENERATED_FILES}
# This creates ${AUTO_GENERATED_FILES_2}, so that shouldn't be a prerequisite.
${MAKE} all_pass2
# These can't be prerequisites because they depend on .class files from Daikon itself.
${MAKE} chicory
${MAKE} dyncomp
.PHONY: java_files.txt
java_files.txt: ${JAVA_FILES}
@echo ${JAVA_FILES} > java_files.txt
.PHONY : daikon compile_daikon
daikon: compile_daikon junit
compile_daikon : ../utils/plume-scripts ${AUTO_GENERATED_FILES}
@echo ${JAVAC_COMMAND} 'daikon/*.java ...'
@${JAVAC_COMMAND} ${DAIKON_JAVA_FILES}
@chmod 444 ${AUTO_GENERATED_FILES}
# ${MAKE} all_pass2
#
# Chicory java front end for Daikon
#
CHICORY_JAVA_FILES := daikon/Chicory.java $(wildcard daikon/chicory/*.java)
ifeq (${JAVA24}, 0)
CHICORY_JAVA_FILES := $(filter-out %24.java, ${CHICORY_JAVA_FILES})
endif
# This actually requires Daikon to already be compiled.
# It would be good to make that an explicit prerequisite.
.PHONY: chicory
.PRECIOUS: ChicoryPremain.jar
chicory : ChicoryPremain.jar chicory-test
.PHONY: chicory-compile
chicory-compile:
${JAVAC_COMMAND} ${CHICORY_JAVA_FILES}
# Note that this compiles all of Chicory even though all we need for
# this step is chicory/ChicoryPremain.java.
# Also note that it always compiles all of Chicory, to handle changing
# between different JDKs. Changing JDKs changes which files are
# compiled, but changing JDKs doesn't cause this Makefile to otherwise
# trigger re-execution.
ChicoryPremain.jar : chicory-compile daikon/chicory/manifest.txt
${JAR} cfm ChicoryPremain.jar daikon/chicory/manifest.txt \
daikon/chicory/ChicoryPremain.class
.PHONY: chicory-test
chicory-test : daikon/chicory/inv_out.diff
daikon/chicory/inv_out.diff : ChicoryPremain.jar
cd daikon/chicory && rm -f ChicoryTest.log ChicoryTest.dtrace.gz ChicoryTest.inv.gz ChicoryTest.inv.out
cd daikon/chicory && ${JAVA_COMMAND} daikon.Chicory --verbose --debug daikon.chicory.ChicoryTest > ChicoryTest.log || (cat ChicoryTest.log; false)
cd daikon/chicory && ${JAVA_COMMAND} daikon.Daikon --no_text_output --no_show_progress ChicoryTest.dtrace.gz
cd daikon/chicory && ${JAVA_COMMAND} daikon.PrintInvariants ChicoryTest.inv.gz > ChicoryTest.inv.out
-diff -uw daikon/chicory/ChicoryTest.inv.out.goal daikon/chicory/ChicoryTest.inv.out \
> daikon/chicory/ChicoryTest.inv.out.diff
@if test ! -s daikon/chicory/ChicoryTest.inv.out.diff ; then echo No Errors; \
else echo Errors: more daikon/chicory/ChicoryTest.inv.out.diff for details; fi
#
# Dynamic Comparability (DynComp/Java; also Chicory)
#
INSTRUMENTATION_JAVA_FILES := daikon/DynComp.java $(wildcard daikon/dcomp/*.java daikon/chicory/*.java)
ifeq (${JAVA24}, 0)
INSTRUMENTATION_JAVA_FILES := $(filter-out %24.java, ${INSTRUMENTATION_JAVA_FILES})
endif
DCOMP_ARGS := --ppt-select-pattern=daikon.dcomp.DcompTest
DCOMP_DIR := daikon/dcomp
# Build DynComp/Java, check the DF summary info and run a sanity test
.PHONY: dyncomp dcomp
dyncomp dcomp : plume-import-check dcomp_premain.jar dcomp-test
# Note that this compiles all of dcomp even though all we need for
# this step is dcomp/Premain.java.
dcomp_premain.jar : ${INSTRUMENTATION_JAVA_FILES} daikon/dcomp/manifest.txt
${JAVAC_COMMAND} ${INSTRUMENTATION_JAVA_FILES}
${JAR} cfm dcomp_premain.jar daikon/dcomp/manifest.txt \
daikon/dcomp/Premain.class
# Runs a simple sanity test on DynComp/Java without an instrumented JDK
# Also creates file ./DcompTest.decls-DynComp
# To debug a problem, change '--dump' to '--debug'
.PHONY: dcomp-test
dcomp-test : daikon/dcomp/std_dcomp_out.diff
daikon/dcomp/std_dcomp_out.diff : dcomp_premain.jar
/bin/rm -rf /tmp/${USER}/bin/* /tmp/${USER}/orig/*
cd daikon/dcomp && ${JAVA_COMMAND} \
daikon.DynComp ${DCOMP_ARGS} --verbose --dump \
--comparability-file=std_dcomp_out.txt --rt-file=NONE \
daikon.dcomp.DcompTest > DcompTest.log 2>&1
-diff -uw daikon/dcomp/std_dcomp_out.goal daikon/dcomp/std_dcomp_out.txt \
> daikon/dcomp/std_dcomp_out.diff
@if test ! -s daikon/dcomp/std_dcomp_out.diff ; then echo No Errors; \
else echo Errors: more daikon/dcomp/std_dcomp_out.diff for details; fi
dyncomp-test-jdk dcomp-test-jdk : dcomp_premain.jar
/bin/rm -rf /tmp/${USER}/bin/* /tmp/${USER}/orig/*
${JAVA_COMMAND} \
daikon.DynComp ${DCOMP_ARGS} \
--comparability-file=daikon/dcomp/jdk_dcomp_out.txt daikon/dcomp/DcompTest
-diff -u daikon/dcomp/jdk_dcomp_out.goal daikon/dcomp/jdk_dcomp_out.txt \
> daikon/dcomp/jdk_dcomp_out.diff
@if test ! -s daikon/dcomp/jdk_dcomp_out.diff ; then echo No Errors; \
else echo Errors: more daikon/dcomp/jdk_dcomp_out.diff for details; fi
dyncomp-update-goals dcomp-update-goals:
cp daikon/dcomp/std_dcomp_out.txt daikon/dcomp/std_dcomp_out.goal
cp daikon/dcomp/jdk_dcomp_out.txt daikon/dcomp/jdk_dcomp_out.goal
#
# Rules to build the instrumented JDK for DynComp/Java
#
DCOMP_RT := dcomp-rt
dyncomp-jdk dcomp-jdk : dcomp_rt.jar
${DCOMP_RT} dcomp_rt.jar : dcomp_premain.jar
/bin/rm -rf ${DCOMP_RT}
${INSTALL} -d ${DCOMP_RT}
${JAVA_COMMAND} -Xmx7g daikon.dcomp.${BuildJDKTool} ${DCOMP_RT}
# "then" clause is Java 8, "else" clause is Java 9+.
# For Java 9+, there appears to be a bug in the Java reflection invoke code that it
# does not check that the arg list matches. Hence, it tries to invoke
# our instrumented version from non instrumented code. This causes a
# failure during java initialization of boot layer. It also causes additional
# failures during some java class loading. Thus we must remove
# the problem classes from dcomp_rt.jar.
@if test -f ${DCOMP_RT}/META-INF/MANIFEST.MF; then \
${JAR} cmf ${DCOMP_RT}/META-INF/MANIFEST.MF dcomp_rt.jar -C ${DCOMP_RT} .; \
else \
rm ${DCOMP_RT}/java/lang/invoke/VarHandle*Field*.class; \
cp daikon/dcomp-dummy/DCRuntime.class.dummy ${DCOMP_RT}/java/lang/DCRuntime.class; \
${JAR} cf dcomp_rt.jar -C ${DCOMP_RT} .; \
fi
# Install the local version of the dyncomp specific rt.jar
install-dyncomp-jdk install-dcomp-jdk : dcomp_rt.jar
cp dcomp_rt.jar ${pag}/software/arch/common/pkg/DynComp/
# Only rebuild the jar file, don't recreate the contents of ${DCOMP_RT}.
# Useful if editing only one file in the jar.
dyncomp-jdk-only dcomp-jdk-only :
@if test -f ${DCOMP_RT}/META-INF/MANIFEST.MF; then \
${JAR} cmf ${DCOMP_RT}/META-INF/MANIFEST.MF dcomp_rt.jar -C ${DCOMP_RT} .; \
else \
rm ${DCOMP_RT}/java/lang/invoke/VarHandleInts?Field*.class; \
${JAR} cf dcomp_rt.jar -C ${DCOMP_RT} .; \
fi
## These two rules create the directories if absent but don't update them.
../utils/plume-scripts:
${MAKE} -C .. update-plume-scripts
../utils/html-tools:
${MAKE} -C .. update-html-tools
.PHONY: update-plume-scripts
update-plume-scripts:
${MAKE} -C .. update-plume-scripts
# Checks that daikon.plumelib, rather than plume, is imported by source files
# that do instrumentation. Should also check that daikon.plumelib is never
# imported by non-instrumentation files.
.PHONY: plume-import-check
plume-import-check :
@echo -n "Checking that imports of plume and daikon.plumelib are correct..."
@if [ -n "`grep '^import org.plumelib' ${INSTRUMENTATION_JAVA_FILES}`" ]; then \
echo ""; \
echo "*** ERROR: Do not import org.plumelib.* from DynComp code. It would be"; \
echo " instrumented when DynComp or Chicory is run. Please use the"; \
echo " (identical) daikon.plumelib package, which will not be instrumented."; \
echo "The following files import from plume:"; \
grep -n '^import org.plumelib.*' ${INSTRUMENTATION_JAVA_FILES}; \
false; \
else \
echo "done"; \
fi
## Use this when you don't want $inv/tests makefiles to restart
JAVA_FILES_EXCEPT_DAIKON = $(subst ./daikon/Daikon.java,,${JAVA_FILES})
ifeq (${JAVA24}, 0)
JAVA_FILES_EXCEPT_DAIKON := $(filter-out %24.java, ${JAVA_FILES_EXCEPT_DAIKON})
endif
all_except_daikon: ../utils/plume-scripts ${AUTO_GENERATED_FILES}
@echo ${JAVAC_COMMAND} '*.java ... (except Daikon.java)'
@${JAVAC_COMMAND} ${JAVA_FILES_EXCEPT_DAIKON}
@chmod a-w ${AUTO_GENERATED_FILES}
${MAKE} all_pass2
.PHONY: all_pass2
all_pass2: ${AUTO_GENERATED_CLASSES_2}
all_except: all_except_daikon
all_force: all_directly
all_via_javac:
${MAKE} JAVAC='javac' all
all_javac: all_via_javac
javac: all_via_javac
# These rules are undesirable, because Daikon.class (or Diff.class) might
# be up to date even if other files aren't.
daikon/Daikon.class: daikon/Daikon.java ../utils/plume-scripts ${AUTO_GENERATED_FILES}
${JAVAC_COMMAND} daikon/Daikon.java
daikon/Diff.class: Diff.java ../utils/plume-scripts ${AUTO_GENERATED_FILES}
${JAVAC_COMMAND} daikon/Diff.java
###########################################################################
### Cleaning (removing generated files
###
# It's good to run "make clean" occasionally, because it costs little to
# regenerate .class files and it's bad to continue to use an orphaned class
# file (whose source file was renamed). Or, run "orphaned-class-files".
# The (slight) downside is that the regenerated .class files might cause some
# Make rules to unnecessarily re-run, if the code hasn't actually changed.
clean_class_files:
# remove 'bin' and 'orig' after versions stablize
-rm -f `find . -path "*/debug*/bin" -prune -o -path "*/debug*/orig" -prune -o -path "*/debug*/instrumented" -prune -o -path "*/debug*/uninstrumented" -prune -o -name "*.class" -print`
# java/daikon might be a symbolic link; the alternative is to pass
# "-follow" to the above find command, but I don't necessarily
# want to remove everything reachable through symbolic links.
# remove 'bin' and 'orig' after versions stablize
-rm -f `find daikon -follow -path "*/debug*/bin" -prune -o -path "*/debug*/orig" -prune -o -path "*/debug*/instrumented" -prune -o -path "*/debug*/uninstrumented" -prune -o -name "*.class" -print`
-rm -f ${OLD_AUTO_GENERATED_FILES}
clean:
${MAKE} clean_class_files
-rm -f ChicoryPremain.jar
-rm -f daikon/chicory/ChicoryTest.log
clean-generated-files:
-rm -f ${AUTO_GENERATED_FILES} ${AUTO_GENERATED_FILES_2}
# Could/should remove plume-scripts here, too.
veryclean: very_clean
very_clean: very-clean
very-clean: clean clean-generated-files
-rm -f TAGS
-rm -rf dcomp_premain.jar dcomp_rt.jar ${DCOMP_RT}
-rm -rf api/
-rm -rf daikon/chicory/ChicoryTest.inv.out
-rm -rf daikon/chicory/debug/
-rm -rf daikon/dcomp/DcompTest.log
-rm -rf daikon/dcomp/debug/
-rm -rf daikon/dcomp/std_dcomp_out.diff daikon/dcomp/std_dcomp_out.txt
run: all
${JAVA_COMMAND} daikon.Daikon
ifneq (,$(shell which etags))
## The etags program exists
ifneq (,$(findstring Exuberant, $(shell etags --version 2>&1)))
ETAGS := etags --language-force=java
else
ETAGS := etags --language=java
endif
endif
TAGS: tags
.PHONY: etags tags
etags: tags
tags: ../utils/plume-scripts
ifndef ETAGS
$(error etags is not available, please install it)
endif
@echo etags '*.java ...'
@${ETAGS} ${TAG_FILES}
# A TAGS file that does not contain generated files
# When doing certain search/replace tasks, it's better to omit generated files
tags-nogen: tags-without-generated-files
tags-sans-generated: tags-without-generated-files
tags-without-generated-files: clean-generated-files
${MAKE} tags
${MAKE} compile
# A TAGS file that does not contain jtb-generated files.
tags-nojtb: ../utils/plume-scripts
ifndef ETAGS
$(error etags is not available, please install it)
endif
@echo etags '*.java ...'
@${ETAGS} ${TAG_FILES_NO_JTB}
###########################################################################
### Code quality (static checks of the code)
###
# See version numbers at https://github.com/google/error-prone/releases
# and https://errorprone.info/docs/installation.
# Only run under Java 21+.
error-prone-version = 2.42.0
extra-error-prone-args-1 = --should-stop=ifError=FLOW
ERRORPRONE_PROCESSOR_PATH := ${DAIKONDIR}/java/lib/error-prone/error_prone_core-${error-prone-version}-with-dependencies.jar:${DAIKONDIR}/java/lib/error-prone/dataflow-errorprone-3.49.3-eisop1.jar
JAVAC_ANNOTATION_PROCESSOR_ARGS ?= \
-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED \
-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED \
-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED \
-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
error-prone: errorprone
errorprone: compile errorprone-nocompile
# Some of the -Xep are temporary
# -Xep:PatternMatchingInstanceof:OFF requires Java 17 source code
errorprone-nocompile:
ifneq (${JAVA21}, 1)
@echo "Error Prone is only run under Java 21+"
else
@echo "Using Error Prone version ${error-prone-version}"
## MutablePublicArray is off because it suggests a dependency on Google Guava.
javac -cp ${DAIKON_CLASSPATH} \
${JAVAC_ANNOTATION_PROCESSOR_ARGS} \
-XDcompilePolicy=simple -processorpath ${ERRORPRONE_PROCESSOR_PATH} \
'-Xplugin:ErrorProne -Xep:ReferenceEquality:OFF -Xep:StringSplitter:OFF -Xep:AnnotateFormatMethod:OFF -Xep:MutablePublicArray:OFF -Xep:DoNotCallSuggester:OFF -Xep:InlineMeSuggester:OFF -Xep:CanIgnoreReturnValueSuggester:OFF -Xep:ExtendsObject:OFF -Xep:PatternMatchingInstanceof:OFF -Xep:StatementSwitchToExpressionSwitch:OFF' \
-Xmaxwarns 100000 \
-Werror \
${extra-error-prone-args-1} \
${JAVA_FILES_FOR_STYLE}
endif
# THIS IS BROKEN - IS IT EVER USED?
# Create an `error-prone.patch` file.
errorprone-replacements:
javac -cp ${DAIKON_CLASSPATH} \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
-XDcompilePolicy=simple -processorpath ${ERRORPRONE_PROCESSOR_PATH} \
'-Xplugin:ErrorProne -XepPatchChecks:UnnecessaryParentheses,ArrayToString -XepPatchLocation:${DAIKONDIR}/java' \
-Xmaxwarns 100000 \
${extra-error-prone-args-1} \
${JAVA_FILES_FOR_STYLE}
findbugs: .findbugs-output
.PHONY: findbugs
# Takes about 20 minutes on manioc as of June 2005.
.findbugs-output: ../daikon.jar
${MAKE} findbugs-nocompile
# WARNING: This does not use the class files, but the .jar file.
# So make sure it's up to date before using this.
# WARNING: I don't think this will work unless you're logged on as Michael Ernst.
findbugs-nocompile:
rm -f .findbugs-output
~mernst/bin/share/findbugs -emacs -textui -property "findbugs.maskedfields.locals=true" -property "findbugs.de.comment=true" -exclude .findbugs-exclude.xml -maxHeap 750 ../daikon.jar | tee .findbugs-output
# This target is aimed at M-x compile in Emacs. The output is misleading
# if the .findbugs-output file might be old, or the daikon.jar file is old.
findbugs-cat:
cat .findbugs-output
.PHONY: jar
jar: ../daikon.jar
../daikon.jar: ../utils/plume-scripts ${AUTO_GENERATED_FILES} compile
${MAKE} -C .. daikon.jar
jlint:
jlint . | grep -v "Value of referenced variable '.*' may be NULL" | grep -v "Compare strings as object references" | perl -p -e 's:^daikon/::'
# "(cd $inv; maudit daikon)" does not work; I don't understand why.
# Unfortunately, this is way too much output; I need to filter it.
# Maybe write my own script to do that...
audit:
cd ${HOME}/java && maudit daikon | perl -p -e 's/^daikon\///'
.PHONY: reformat check-format
format: reformat
reformat:
ifeq (${JAVA17}, 0)
echo "Formatting is not run under Java ${JAVA_VERSION_STRING}"
else
${MAKE} -C .. update-run-google-java-format
@../utils/run-google-java-format/run-google-java-format.py \
${JAVA_FILES_FOR_FORMAT}
endif
check-format:
ifeq (${JAVA17}, 0)
echo "Formatting is not run under Java ${JAVA_VERSION_STRING}"
else
${MAKE} -C .. update-run-google-java-format
@../utils/run-google-java-format/check-google-java-format.py \
${JAVA_FILES_FOR_FORMAT} || (echo "Try running: make reformat" && /bin/false)
endif
###########################################################################
### Pluggable type checkers
###
# (Don't run these until after you have compiled Daikon at least once.)
# Note about CHECKER_ARGS: if this contains any -Alint option, it will
# override (not augment) any other use of -Alint in this Makefile.
# "-proc:only" prevents generation of .class files (so generated classfiles are
# version 8 rather than version 9, and so typecheck jobs can be run in parallel).
# JAVACHECK_EXTRA_ARGS is set only by the user (and is currently used by Travis).
CHECKER_ARGS_ALL_JDK_VERSIONS ?= -Xmaxerrs 10000 -Xmaxwarns 10000 -Aversion -ArequirePrefixInWarningSuppressions -AwarnUnneededSuppressions -AwarnRedundantAnnotations -XDignore.symbol.file -Xlint:deprecation -proc:only -processorpath ${CHECKERFRAMEWORK_JAR} ${JAVACHECK_EXTRA_ARGS}
ifneq (,$(findstring 1.8.,$(shell java -version 2>&1)))
CHECKER_ARGS ?= ${CHECKER_ARGS_ALL_JDK_VERSIONS} -J-Xbootclasspath/p:${CHECKERFRAMEWORK_JAVAC}
else
CHECKER_ARGS ?= ${CHECKER_ARGS_ALL_JDK_VERSIONS} \
${JAVAC_ANNOTATION_PROCESSOR_ARGS}
endif
## All of the following targets need to depend on "compile".
# Just check that the Index Checker doesn't crash -- -AsuppressWarnings="index"
# command-line argument suppresses all type-checking errors.
JAVAC_RESOURCELEAK_ARGS = -processor org.checkerframework.checker.resourceleak.ResourceLeakChecker -implicit:class -Xlint:-processing -AskipDefs='${ALLSYSTEMS_SKIPDEFS}' -ApermitStaticOwning -ApermitInitializationLeak
JAVAC_FORMATTER_ARGS = -processor org.checkerframework.checker.formatter.FormatterChecker -implicit:class -Xlint:-processing -AskipDefs='${ALLSYSTEMS_SKIPDEFS}'
JAVAC_INDEX_ARGS = -processor org.checkerframework.checker.index.IndexChecker -implicit:class -Xlint:-processing -AskipDefs='${INDEX_SKIPDEFS}' -AassumeAssertionsAreEnabled -AsuppressWarnings="index"
# JAVAC_INTERNING_ARGS = -processor org.checkerframework.checker.interning.InterningChecker -implicit:class -Xlint:-processing
JAVAC_INTERNING_ARGS = -processor org.checkerframework.checker.interning.InterningChecker -Alint=-dotequals -implicit:class -Xlint:-processing -AskipDefs='${INTERNING_SKIPDEFS}'
JAVAC_NULLNESS_ARGS = -processor org.checkerframework.checker.nullness.NullnessChecker -implicit:class -Xlint:-processing -AskipDefs='${ALLSYSTEMS_SKIPDEFS}'
JAVAC_PROTOTYPE_ARGS = -processor org.checkerframework.common.subtyping.SubtypingChecker -Aquals=typequals.Prototype,typequals.NonPrototype -implicit:class -Xlint:-processing -J-Dcheckers.skipUses='^java\.'
JAVAC_REGEX_ARGS = -processor org.checkerframework.checker.regex.RegexChecker -implicit:class -Xlint:-processing -AskipDefs='${ALLSYSTEMS_SKIPDEFS}'
JAVAC_REGEX_QUAL_ARGS = -processor org.checkerframework.checker.experimental.regex_qual.RegexCheckerAdapter -implicit:class -Xlint:-processing -AskipDefs='${ALLSYSTEMS_SKIPDEFS}'
JAVAC_SIGNATURE_ARGS = -processor org.checkerframework.checker.signature.SignatureChecker -implicit:class -Xlint:-processing -AskipDefs='${ALLSYSTEMS_SKIPDEFS}'
JAVAC_SIGNEDNESS_ARGS = -processor org.checkerframework.checker.signedness.SignednessChecker -implicit:class -Xlint:-processing -AskipDefs='${ALLSYSTEMS_SKIPDEFS}'
JAVAC_VINDEX_ARGS = -processor org.checkerframework.common.subtyping.SubtypingChecker -Aquals=typequals.VIndexTop,typequals.ValueIndex,typequals.VarIndex,typequals.VIndexUnqualified,typequals.VIndexBottom -implicit:class -Xlint:-processing -J-Dcheckers.skipUses='^java\.'
# -AsuppressWarnings=lock:method.guarantee.violated,lock:override.sideeffect is temporary.
# Once the Purity Checker and -AsuggestPureMethods are fixed, they can be run on plume-lib
# and Daikon and this can be removed. The method.guarantee.violated warning is issued by
# the Lock Checker when a method calls another method with a weaker side effect guarantee.
# The override.sideeffect warning is issued by the Lock Checker when the side effect
# annotation on the overridder method is weaker than that on the overridden method.
JAVAC_LOCK_ARGS = -processor org.checkerframework.checker.lock.LockChecker -AsuppressWarnings=lock:method.guarantee.violated,lock:override.sideeffect -implicit:class -Xlint:-processing -AskipDefs='${ALLSYSTEMS_SKIPDEFS}'
JAVAC_JAVARI_ARGS = -processor org.checkerframework.checker.javari.JavariChecker -implicit:class -Xlint:-processing -AskipDefs='${ALLSYSTEMS_SKIPDEFS}'
JAVAC_IGJ_ARGS = -processor org.checkerframework.checker.igj.IGJChecker -implicit:class -Xlint:-processing -AskipDefs='${ALLSYSTEMS_SKIPDEFS}'
## Code in dcomp directory is not called directly; annotations would be useless.
INDEX_SKIPDEFS = ^daikon\.dcomp\|^jtb\.
INTERNING_SKIPDEFS = ^daikon\.dcomp\|^jtb\.
ALLSYSTEMS_SKIPDEFS=^jtb\.
INDEX_JAVA_FILES = ${DAIKON_JAVA_FILES}
# Intern.java implements interning and so has very many annotations. VarInfoName
# is obsolescent, retained for backward compatibility only; it is of flawed design
# and has 60 @Interned annotations and quite a few SuppressWarnings.
INTERNING_JAVA_FILES_SKIP_COUNTS = Intern.java\|VarInfoName.java\|daikon/dcomp
## Which files to check.
INTERNING_JAVA_FILES = ${DAIKON_JAVA_FILES}
INTERNING_JAVA_FILES_COUNTS := $(shell find . -type f -name '*.java' | egrep -v ${INTERNING_JAVA_FILES_SKIP_COUNTS} | xargs grep -l -i '@Interned' | ${SORT_DIRECTORY_ORDER})
NULLNESS_JAVA_FILES = ${DAIKON_JAVA_FILES}
# $(shell find daikon -name '*.java' -a -exec grep -L "^@SuppressWarnings.*nullness" {} \; | sort)
# $(shell find typequals/ -name '*.java')
show_nullness_java_files:
@echo NULLNESS_JAVA_FILES:
@echo ${NULLNESS_JAVA_FILES}
@echo DAIKON_JAVA_FILES:
@echo ${DAIKON_JAVA_FILES}
## TODO: Reinstate these dependencies later: typecheck-prototype typecheck-vindex
# Check is in multiple parts because Travis won't run jobs longer than 50 minutes
# and because CI memory can get exhausted on multiple CI platforms (why?).
# Index Checker takes much longer than any other checker.
# Typechecking times (in minutes, as of 2025-11-03):
# formatter 1.25
# index 9
# interning 1.25
# nullness 3
# lock 1.75