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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
|
# Source directories
export TOP_BUILD_DIR = $(abs_top_builddir)
export NETX_DIR = $(abs_top_builddir)/netx.build
export NETX_SRCDIR = $(abs_top_srcdir)/netx
export NETX_RESOURCE_DIR=$(NETX_SRCDIR)/net/sourceforge/jnlp/resources
export REPORT_STYLES_DIRNAME=report-styles
export TESTS_SRCDIR=$(abs_top_srcdir)/tests
export TESTS_DIR=$(abs_top_builddir)/tests.build
export NETX_UNIT_TEST_SRCDIR=$(TESTS_SRCDIR)/netx/unit
export NETX_TEST_DIR=$(TESTS_DIR)/netx
export NETX_UNIT_TEST_DIR=$(NETX_TEST_DIR)/unit
export JUNIT_RUNNER_DIR=$(TESTS_DIR)/junit-runner
export JUNIT_RUNNER_SRCDIR=$(TESTS_SRCDIR)/junit-runner
export JACOCO_OPERATOR_DIR=$(TESTS_DIR)/jacoco-operator
export JACOCO_OPERATOR_SRCDIR=$(TESTS_SRCDIR)/jacoco-operator
export TEST_EXTENSIONS_SRCDIR=$(TESTS_SRCDIR)/test-extensions
export TEST_EXTENSIONS_TESTS_SRCDIR=$(TESTS_SRCDIR)/test-extensions-tests
export REPRODUCERS_TESTS_SRCDIR=$(TESTS_SRCDIR)/reproducers
export TEST_EXTENSIONS_DIR=$(TESTS_DIR)/test-extensions
export CPP_UNITTEST_FRAMEWORK_SRCDIR=$(TESTS_SRCDIR)/UnitTest++
export CPP_UNITTEST_SRCDIR=$(TESTS_SRCDIR)/cpp-unit-tests
export CPP_UNITTEST_DIR=$(TESTS_DIR)/cpp-unit-tests
export TEST_EXTENSIONS_COMPATIBILITY_SYMLINK=$(TESTS_DIR)/netx/jnlp_testsengine
export TEST_EXTENSIONS_TESTS_DIR=$(TESTS_DIR)/test-extensions-tests
export REPRODUCERS_TESTS_SERVER_DEPLOYDIR=$(TESTS_DIR)/reproducers_test_server_deploydir
export REPRODUCERS_BUILD_DIR=$(TESTS_DIR)/reproducers.classes
export PRIVATE_KEYSTORE_NAME=teststore.ks
export PRIVATE_KEYSTORE_PASS=123456789
export EXPORTED_TEST_CERT_PREFIX=icedteatests
export EXPORTED_TEST_CERT_SUFFIX=crt
export TEST_CERT_ALIAS=icedteaweb
export PUBLIC_KEYSTORE_STUB=icedtea-web/security/trusted.certs
export PUBLIC_KEYSTORE_PASS=changeit
export SOFTKILLER=softkiller
export JUNIT_RUNNER_JAR=$(abs_top_builddir)/junit-runner.jar
export UNIT_CLASS_NAMES = $(abs_top_builddir)/unit_class_names
export REPRODUCERS_CLASS_NAMES = $(abs_top_builddir)/reproducers_class_names
export REPRODUCERS_CLASS_WHITELIST = $(abs_top_srcdir)/netx-dist-tests-whitelist
export EMMA_JAVA_ARGS=-Xmx2G
export EMMA_MODIFIED_FILES=tests-output.xml ServerAccess-logs.xml stdout.log stderr.log all.log
export EMMA_BACKUP_SUFFIX=_noEmma
export EMMA_SUFFIX=_withEmma
export META_MANIFEST = META-INF/MANIFEST.MF
export SIGNED_REPRODUCERS=signed signed2
export SIMPLE_REPRODUCERS=simple
export CUSTOM_REPRODUCERS=custom
export ALL_NONCUSTOM_REPRODUCERS=$(SIMPLE_REPRODUCERS) $(SIGNED_REPRODUCERS)
export ALL_REPRODUCERS=$(ALL_NONCUSTOM_REPRODUCERS) $(CUSTOM_REPRODUCERS)
export JACOCO_PATH:=$(shell dirname "$(JACOCO_JAR)")
export JACOCO_AGENT=org.jacoco.agent.jar
export JACOCO_ANT=org.jacoco.ant.jar
export JACOCO_REPORT=org.jacoco.report.jar
export JACOCO_AGENTRT=org.jacoco.agent.rt.jar
export JACOCO_CORE=org.jacoco.core.jar
export JACOCO_JAVAWS_RESULTS=$(TEST_EXTENSIONS_DIR)/jacoco_javaws.exec
export JACOCO_PLUGIN_RESULTS=$(TEST_EXTENSIONS_DIR)/jacoco_plugin.exec
export JACOCO_CLASSPATH=$(JACOCO_PATH)/$(JACOCO_CORE):$(JACOCO_PATH)/$(JACOCO_AGENT):$(JACOCO_PATH)/$(JACOCO_REPORT):$(JACOCO_PATH)/$(JACOCO_AGENTRT):$(JACOCO_PATH)/$(JACOCO_ANT):$(ASM_JAR)
export JACOCO_AGENT_SWITCH_BODY=-javaagent:$(JACOCO_PATH)/$(JACOCO_AGENTRT)
export JACOCO_BASE_EXCLUDE=org.junit.*:junit.*
export JACOCO_ADVANCED_EXCLUDE=:*jacoco*:java.lang.*:java.reflect.*:java.util.*:sun.reflect.*
export JACOCO_AGENT_SWITCH="$(JACOCO_AGENT_SWITCH_BODY)=excludes=$(JACOCO_BASE_EXCLUDE)"
export JACOCO_AGENT_JAVAWS_SWITCH=\"$(JACOCO_AGENT_SWITCH_BODY)=excludes=$(JACOCO_BASE_EXCLUDE)$(JACOCO_ADVANCED_EXCLUDE),xboot=true,destfile=$(JACOCO_JAVAWS_RESULTS)\"
export JACOCO_AGENT_PLUGIN_SWITCH=\"$(JACOCO_AGENT_SWITCH_BODY)=excludes=$(JACOCO_BASE_EXCLUDE)$(JACOCO_ADVANCED_EXCLUDE),xboot=true,destfile=$(JACOCO_PLUGIN_RESULTS)\"
export JACOCO_OPERATOR_EXEC=$(BOOT_DIR)/bin/java $(EMMA_JAVA_ARGS) -cp $(JACOCO_OPERATOR_DIR):$(JACOCO_CLASSPATH):. org.jacoco.operator.Main
# linking variables
export PLUGIN_LINK_NAME=libjavaplugin.so
export MOZILLA_LOCAL_PLUGINDIR=${HOME}/.mozilla/plugins
export MOZILLA_GLOBAL64_PLUGINDIR=/usr/lib64/mozilla/plugins
export MOZILLA_GLOBAL32_PLUGINDIR=/usr/lib/mozilla/plugins
export OPERA_GLOBAL64_PLUGINDIR=/usr/lib64/opera/plugins
export OPERA_GLOBAL32_PLUGINDIR=/usr/lib/opera/plugins
export BUILT_PLUGIN_LIBRARY=IcedTeaPlugin.so
export CPP_UNITTEST_FRAMEWORK_BUILDDIR=$(CPP_UNITTEST_DIR)/UnitTest++
export CPP_UNITTEST_FRAMEWORK_LIB_NAME=libUnitTest++.a
export CPP_UNITTEST_FRAMEWORK_LIB=$(CPP_UNITTEST_FRAMEWORK_BUILDDIR)/$(CPP_UNITTEST_FRAMEWORK_LIB_NAME)
export CPP_UNITTEST_EXECUTABLE=$(CPP_UNITTEST_DIR)/IcedTeaPluginUnitTests
export MOZILLA_LOCAL_BACKUP_FILE=${HOME}/$(PLUGIN_LINK_NAME).origU
export MOZILLA_GLOBAL_BACKUP_FILE=${HOME}/$(PLUGIN_LINK_NAME).origMG
export OPERA_GLOBAL_BACKUP_FILE=${HOME}/$(PLUGIN_LINK_NAME).origOG
export MOZILLA_FAMILY_TEST= "$(FIREFOX)" != "" -o "$(CHROMIUM)" != "" -o "$(CHROME)" != "" -o "$(MIDORI)" != "" -o "$(EPIPHANY)" != ""
# end of linking variables
# Build directories
export BOOT_DIR = $(abs_top_builddir)/bootstrap/jdk1.6.0
if WITH_RHINO
RHINO_RUNTIME=:$(RHINO_JAR)
else
RHINO_RUNTIME=
endif
export RUNTIME = $(BOOT_DIR)/jre/lib/rt.jar:$(BOOT_DIR)/jre/lib/jsse.jar$(RHINO_RUNTIME):$(BOOT_DIR)/jre/lib/resources.jar
# Flags
export IT_CFLAGS=$(CFLAGS) $(ARCHFLAG)
export IT_JAVAC_SETTINGS=-g -encoding utf-8 $(JAVACFLAGS) $(MEMORY_LIMIT) $(PREFER_SOURCE)
export IT_LANGUAGE_SOURCE_VERSION=6
export IT_CLASS_TARGET_VERSION=6
export IT_JAVACFLAGS=$(IT_JAVAC_SETTINGS) -source $(IT_LANGUAGE_SOURCE_VERSION) -target $(IT_CLASS_TARGET_VERSION)
#
# We need the jars in bootclasspath for a couple of reasons
# - we use classes (in the sun.applet package) loaded by the bootclassloader
# using another classloader to load classes from the same package causes an
# IllegalAccessException
# - we want full privileges
#
export LAUNCHER_BOOTCLASSPATH="-Xbootclasspath/a:$(datadir)/$(PACKAGE_NAME)/netx.jar$(RHINO_RUNTIME):$(TAGSOUP_JAR)"
export PLUGIN_BOOTCLASSPATH='"-Xbootclasspath/a:$(datadir)/$(PACKAGE_NAME)/plugin3.jar$(RHINO_RUNTIME):$(TAGSOUP_JAR)"'
export PLUGIN_COVERAGE_BOOTCLASSPATH='"-Xbootclasspath/a:$(datadir)/$(PACKAGE_NAME)/plugin3.jar$(RHINO_RUNTIME):$(JACOCO_CLASSPATH):$(TAGSOUP_JAR)"'
# Fake update version to work with the Deployment Toolkit script used by Oracle
# http://download.oracle.com/javase/tutorial/deployment/deploymentInDepth/depltoolkit_index.html
export JDK_UPDATE_VERSION=50
# Sources list
export PLUGIN_TEST_SRCS = $(abs_top_srcdir)/plugin/tests/LiveConnect/*.java
export NETX_PKGS = javax.jnlp net.sourceforge.nanoxml net.sourceforge.jnlp \
net.sourceforge.jnlp.about \
net.sourceforge.jnlp.cache net.sourceforge.jnlp.config \
net.sourceforge.jnlp.controlpanel net.sourceforge.jnlp.event \
net.sourceforge.jnlp.runtime net.sourceforge.jnlp.security \
net.sourceforge.jnlp.security.viewer net.sourceforge.jnlp.services \
net.sourceforge.jnlp.tools net.sourceforge.jnlp.util
NETX_EXCLUDE_SRCS=
# Conditional defintions
if HAVE_TAGSOUP
NETX_CLASSPATH_ARG=-classpath $(TAGSOUP_JAR)
else
NETX_EXCLUDE_SRCS+=net.sourceforge.jnlp.MalformedXMLParser.java
endif
if ENABLE_PLUGIN
export ICEDTEAPLUGIN_CLEAN = clean-IcedTeaPlugin
export LIVECONNECT_DIR = netscape sun/applet jogamp/plugin/applet
export PLUGIN_DIR=$(abs_top_builddir)/plugin/icedteanp
export PLUGIN_SRCDIR=$(abs_top_srcdir)/plugin/icedteanp
export LIVECONNECT_SRCS = $(PLUGIN_SRCDIR)/java
export ICEDTEAPLUGIN_TARGET = $(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) stamps/liveconnect-dist.stamp
export PLUGIN_PKGS = sun.applet netscape.security netscape.javascript
#this is for plugin testcoverage
export COVERABLE_PLUGIN_DIR=$(TESTS_DIR)/icedteanp-build-with-jacoco
endif
if CP_SUPPORTS_REFLINK
REFLINK = --reflink=auto
endif
if SRC_DIR_HARDLINKABLE
SRC_DIR_LINK = -l
else
SRC_DIR_LINK = $(REFLINK)
endif
if ENABLE_DOCS
JAVADOC_OPTS=-use -keywords -encoding UTF-8 -splitIndex \
-bottom '<font size="-1"> <a href="http://icedtea.classpath.org/bugzilla">Submit a bug or feature</a></font>'
if JAVADOC_SUPPORTS_J_OPTIONS
JAVADOC_MEM_OPTS=-J-Xmx1024m -J-Xms128m
endif
endif
if WITH_RHINO
RHINO_TESTS=stamps/check-pac-functions.stamp
else
RHINO_TESTS=
endif
if WITH_JUNIT
JUNIT_TESTS=stamps/run-netx-unit-tests.stamp
else
JUNIT_TESTS=
endif
export PLUGIN_VERSION = IcedTea-Web $(FULL_VERSION)
export EXTRA_DIST = $(top_srcdir)/netx $(top_srcdir)/plugin javaws.png javaws.desktop.in launcher \
itweb-settings.desktop.in $(top_srcdir)/tests html-gen.sh netx-dist-tests-whitelist NEW_LINE_IFS
# reproducers `D`shortcuts
export DTEST_SERVER=-Dtest.server.dir=$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)
export DJAVAWS_BUILD=-Djavaws.build.bin=$(DESTDIR)$(bindir)/$(javaws)
export DBROWSERS=-Dused.browsers=$(FIREFOX):$(CHROMIUM):$(CHROME):$(OPERA):$(MIDORI):$(EPIPHANY)
export REPRODUCERS_DPARAMETERS= $(DTEST_SERVER) $(DJAVAWS_BUILD) $(DBROWSERS) $(BROWSER_TESTS_MODIFICATION)
# end of `D`shortcuts
#exported autoconf copies
export EXPORTED_JAVAC=$(BOOT_DIR)/bin/javac
#end of exported autoconf copies
# binary names
javaws:= $(shell echo javaws | sed '@program_transform_name@')
itweb_settings:= $(shell echo itweb-settings | sed '@program_transform_name@')
# the launcher needs to know $(bindir) and $(datadir) which can be different at
# make-time from configure-time
edit_launcher_script = sed \
-e "s|[@]LAUNCHER_BOOTCLASSPATH[@]|$(LAUNCHER_BOOTCLASSPATH)|g" \
-e "s|[@]JAVAWS_SPLASH_LOCATION[@]|$(datadir)/$(PACKAGE_NAME)/javaws_splash.png|g" \
-e "s|[@]JAVA[@]|$(JAVA)|g" \
-e "s|[@]JRE[@]|$(SYSTEM_JRE_DIR)|g" \
-e "s|[@]MAIN_CLASS[@]|$${MAIN_CLASS}|g" \
-e "s|[@]BIN_LOCATION[@]|$${BIN_LOCATION}|g" \
-e "s|[@]PROGRAM_NAME[@]|$${PROGRAM_NAME}|g"
# Top-Level Targets
# =================
all-local: stamps/netx-dist.stamp stamps/plugin.stamp launcher.build/$(javaws) \
javaws.desktop stamps/docs.stamp launcher.build/$(itweb_settings) itweb-settings.desktop
check-local: $(RHINO_TESTS) $(JUNIT_TESTS)
clean-local: clean-netx clean-plugin clean-liveconnect \
clean-native-ecj clean-launchers clean-desktop-files clean-docs clean-tests clean-bootstrap-directory
if [ -e stamps ] ; then \
rmdir stamps ; \
fi
.PHONY: clean-IcedTeaPlugin clean-add-netx clean-add-netx-debug clean-add-plugin clean-add-plugin-debug \
clean-bootstrap-directory clean-native-ecj clean-desktop-files clean-netx-docs clean-docs clean-plugin-docs \
clean-tests check-local clean-launchers stamps/check-pac-functions.stamp stamps/run-netx-unit-tests.stamp clean-netx-tests \
clean-junit-runner clean-netx-unit-tests
install-exec-local:
${mkinstalldirs} $(DESTDIR)$(bindir) $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/ $(DESTDIR)$(libdir)
if ENABLE_PLUGIN
${INSTALL_PROGRAM} $(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) $(DESTDIR)$(libdir)
${INSTALL_DATA} $(abs_top_builddir)/plugin.all/plugin3.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin3.jar
${INSTALL_DATA} $(abs_top_builddir)/plugin.ext/plugin3-public.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin3-public.jar
${INSTALL_DATA} $(abs_top_builddir)/plugin.ext/plugin3-public-src.zip $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin3-public-src.zip
endif
${INSTALL_DATA} $(NETX_DIR)/lib/classes.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar
${INSTALL_DATA} $(NETX_SRCDIR)/javaws_splash.png $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/javaws_splash.png
${INSTALL_PROGRAM} launcher.build/$(javaws) $(DESTDIR)$(bindir)
${INSTALL_PROGRAM} launcher.build/$(itweb_settings) $(DESTDIR)$(bindir)
install-data-local:
${mkinstalldirs} -d $(DESTDIR)$(mandir)/man1
${INSTALL_DATA} $(NETX_SRCDIR)/javaws.1 $(DESTDIR)$(mandir)/man1
if ENABLE_DOCS
${mkinstalldirs} $(DESTDIR)$(htmldir)
(cd ${abs_top_builddir}/docs/netx; \
for files in $$(find . -type f); \
do \
${INSTALL_DATA} -D $${files} $(DESTDIR)$(htmldir)/netx/$${files}; \
done)
if ENABLE_PLUGIN
(cd ${abs_top_builddir}/docs/plugin; \
for files in $$(find . -type f); \
do \
${INSTALL_DATA} -D $${files} $(DESTDIR)$(htmldir)/plugin/$${files}; \
done)
endif
endif
uninstall-local:
rm -f $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY)
rm -f $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar
rm -f $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin3.jar
rm -f $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin3-public.jar
rm -f $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin3-public-src.jar
rm -f $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar
rm -f $(DESTDIR)$(mandir)/man1/javaws.1
rm -f $(DESTDIR)$(bindir)/$(javaws)
rm -f $(DESTDIR)$(bindir)/$(itweb_settings)
rm -rf $(DESTDIR)$(htmldir)
# Plugin
if ENABLE_PLUGIN
# IcedTeaPlugin.so.
# Separate compile and link invocations to ensure intermediate object
# is listed before -l options. See:
# http://developer.mozilla.org/en/docs/XPCOM_Glue
PLUGIN_SRC=IcedTeaNPPlugin.cc IcedTeaScriptablePluginObject.cc \
IcedTeaJavaRequestProcessor.cc IcedTeaPluginRequestProcessor.cc \
IcedTeaPluginUtils.cc IcedTeaParseProperties.cc
PLUGIN_OBJECTS=IcedTeaNPPlugin.o IcedTeaScriptablePluginObject.o \
IcedTeaJavaRequestProcessor.o IcedTeaPluginRequestProcessor.o \
IcedTeaPluginUtils.o IcedTeaParseProperties.o
$(PLUGIN_DIR)/%.o: $(PLUGIN_SRCDIR)/%.cc
mkdir -p $(PLUGIN_DIR) && \
cd $(PLUGIN_DIR) && \
$(CXX) $(CXXFLAGS) \
$(DEFS) $(VERSION_DEFS) \
-DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \
-DPLUGIN_NAME="\"IcedTea-Web Plugin\"" \
-DPLUGIN_VERSION="\"$(PLUGIN_VERSION)\"" \
-DPACKAGE_URL="\"$(PACKAGE_URL)\"" \
-DMOZILLA_VERSION_COLLAPSED="$(MOZILLA_VERSION_COLLAPSED)" \
-DICEDTEA_WEB_JRE="\"$(SYSTEM_JRE_DIR)\"" \
-DPLUGIN_BOOTCLASSPATH=$(PLUGIN_BOOTCLASSPATH) \
$(GLIB_CFLAGS) \
$(MOZILLA_CFLAGS) \
-fvisibility=hidden \
-fPIC -o $@ -c $<
$(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY): $(addprefix $(PLUGIN_DIR)/,$(PLUGIN_OBJECTS))
cd $(PLUGIN_DIR) && \
$(CXX) $(CXXFLAGS) \
$(PLUGIN_OBJECTS) \
$(GLIB_LIBS) \
$(MOZILLA_LIBS) \
-shared -o $@
# Start of CPP Unit test targets
# Note that UnitTest++ has its own makefile, however this is avoided because it creates an in-source build.
$(CPP_UNITTEST_FRAMEWORK_LIB): $(CPP_UNITTEST_FRAMEWORK_SRCDIR)
mkdir -p $(CPP_UNITTEST_FRAMEWORK_BUILDDIR) && \
pushd $(CPP_UNITTEST_FRAMEWORK_SRCDIR) && \
for cppfile in $$(find $(CPP_UNITTEST_FRAMEWORK_SRCDIR) -name '*.cpp') ; \
do \
objfile="$(CPP_UNITTEST_FRAMEWORK_BUILDDIR)/$$(basename $${cppfile%.cpp}).o" ; \
$(CXX) $(CXXFLAGS) -c $$cppfile -o $$objfile || exit 1 ; \
done ; \
ar cr $(CPP_UNITTEST_FRAMEWORK_LIB) $(CPP_UNITTEST_FRAMEWORK_BUILDDIR)/*.o ; \
popd
clean-unittest++:
rm -f $(CPP_UNITTEST_FRAMEWORK_BUILDDIR)/*.o
rm -f $(CPP_UNITTEST_FRAMEWORK_LIB)
if [ -e $(CPP_UNITTEST_FRAMEWORK_BUILDDIR) ] ; then \
rmdir $(CPP_UNITTEST_FRAMEWORK_BUILDDIR) ; \
fi
stamps/cpp-unit-tests-compile.stamp: $(CPP_UNITTEST_FRAMEWORK_LIB) $(CPP_UNITTEST_SRCDIR) $(addprefix $(PLUGIN_DIR)/,$(PLUGIN_OBJECTS))
mkdir -p $(CPP_UNITTEST_DIR) && \
pushd $(CPP_UNITTEST_SRCDIR) && \
for cppfile in $$(find $(CPP_UNITTEST_SRCDIR) -name '*.cc') ; \
do \
objfile="$(CPP_UNITTEST_DIR)/$$(basename $${cppfile%.cc}).o" ; \
echo "Compiling $$cppfile to $$objfile"; \
$(CXX) $(CXXFLAGS) \
$(DEFS) $(VERSION_DEFS) \
-DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \
-DPLUGIN_NAME="\"IcedTea-Web Plugin\"" \
-DPLUGIN_VERSION="\"$(PLUGIN_VERSION)\"" \
-DPACKAGE_URL="\"$(PACKAGE_URL)\"" \
-DMOZILLA_VERSION_COLLAPSED="$(MOZILLA_VERSION_COLLAPSED)" \
-DICEDTEA_WEB_JRE="\"$(SYSTEM_JRE_DIR)\"" \
-DPLUGIN_BOOTCLASSPATH=$(PLUGIN_BOOTCLASSPATH) \
$(GLIB_CFLAGS) \
$(MOZILLA_CFLAGS) \
"-I$(CPP_UNITTEST_FRAMEWORK_SRCDIR)/src" \
"-I$(PLUGIN_SRCDIR)" \
-o $$objfile -c $$cppfile || exit 1 ; \
done ; \
popd ; \
mkdir -p stamps ; \
touch $@
$(CPP_UNITTEST_EXECUTABLE): $(CPP_UNITTEST_FRAMEWORK_LIB) stamps/cpp-unit-tests-compile.stamp
cd $(CPP_UNITTEST_DIR) && \
$(CXX) $(CXXFLAGS) \
$(addprefix $(PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) \
$(CPP_UNITTEST_DIR)/*.o \
-lrt \
-lpthread \
$(GLIB_LIBS) \
$(MOZILLA_LIBS) \
$(CPP_UNITTEST_FRAMEWORK_LIB)\
$(BUILT_CPP_UNIT_TEST_FRAMEWORK) -o $@
clean-cpp-unit-tests:
rm -f stamps/cpp-unit-tests-compile.stamp
rm -f $(CPP_UNITTEST_EXECUTABLE)
rm -f $(CPP_UNITTEST_DIR)/*.o
run-cpp-unit-tests: $(CPP_UNITTEST_EXECUTABLE)
$(CPP_UNITTEST_EXECUTABLE)
# End of CPP Unit test targets
clean-IcedTeaPlugin:
rm -f $(PLUGIN_DIR)/*.o
rm -f $(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY)
if [ $(abs_top_srcdir) != $(abs_top_builddir) ]; then \
if [ -e $(abs_top_builddir)/plugin/icedteanp ] ; then \
rmdir $(abs_top_builddir)/plugin/icedteanp ; \
rmdir $(abs_top_builddir)/plugin ; \
fi ; \
fi
endif
stamps/plugin.stamp: $(ICEDTEAPLUGIN_TARGET)
mkdir -p stamps
touch stamps/plugin.stamp
clean-plugin: $(ICEDTEAPLUGIN_CLEAN)
rm -f stamps/plugin.stamp
liveconnect-source-files.txt:
if test "x${LIVECONNECT_DIR}" != x; then \
find $(LIVECONNECT_SRCS) -name '*.java' | sort > $@ ; \
fi
touch $@
stamps/liveconnect.stamp: liveconnect-source-files.txt stamps/netx.stamp
if test "x${LIVECONNECT_DIR}" != x; then \
mkdir -p $(abs_top_builddir)/liveconnect && \
$(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \
-d $(abs_top_builddir)/liveconnect \
-bootclasspath $(NETX_DIR):$(RUNTIME) \
$(NETX_CLASSPATH_ARG) \
-sourcepath $(LIVECONNECT_SRCS) \
@liveconnect-source-files.txt ; \
fi
mkdir -p stamps
touch $@
stamps/liveconnect-dist.stamp: stamps/liveconnect.stamp $(abs_top_builddir)/plugin.manifest $(NETX_DIR)/lib/classes.jar
if test "x${LIVECONNECT_DIR}" != x; then \
(cd $(abs_top_builddir)/liveconnect ; \
mkdir -p lib ; \
$(BOOT_DIR)/bin/jar cf lib/classes.jar $(LIVECONNECT_DIR) ; \
cp -pPR $(SRC_DIR_LINK) $(LIVECONNECT_SRCS) src; \
find src -type f -exec chmod 640 '{}' ';' -o -type d -exec chmod 750 '{}' ';'; \
cd src ; \
$(ZIP) -qr $(abs_top_builddir)/liveconnect/lib/src.zip $(LIVECONNECT_DIR) ) ; \
rm -rf $(abs_top_builddir)/plugin.all ; \
mkdir -p $(abs_top_builddir)/plugin.all/src ; \
mkdir -p $(abs_top_builddir)/plugin.all/classes ; \
(cd $(abs_top_builddir)/plugin.all/src ; \
cp -a $(abs_top_builddir)/liveconnect/* $(abs_top_builddir)/plugin.all/src/ ; \
rm -rf sun/applet/Applet3MessageHandler.java ; \
unzip $(NETX_DIR)/lib/src.zip ; \
$(ZIP) -qr ../plugin3-src.zip . ) ; \
(cd $(abs_top_builddir)/plugin.all/classes ; \
unzip $(abs_top_builddir)/liveconnect/lib/classes.jar ; \
rm -rf META-INF sun/applet/Applet3MessageHandler.class ; \
unzip $(NETX_DIR)/lib/classes.jar ; \
rm -rf META-INF ; \
$(BOOT_DIR)/bin/jar cfm ../plugin3.jar \
$(abs_top_builddir)/plugin.manifest \
javax/jnlp net com/jogamp/plugin/ui com/jogamp/plugin/applet jogamp/applet jogamp/plugin/jnlp sun/applet \
$(LIVECONNECT_DIR) ) ; \
rm -rf $(abs_top_builddir)/plugin.ext ; \
mkdir -p $(abs_top_builddir)/plugin.ext/src ; \
mkdir -p $(abs_top_builddir)/plugin.ext/classes ; \
(cd $(abs_top_builddir)/plugin.ext/src ; \
mkdir -p com/jogamp ; \
cp -a $(abs_top_builddir)/netx/com/jogamp/plugin com/jogamp/ ; \
$(ZIP) -qr ../plugin3-public-src.zip . ) ; \
(cd $(abs_top_builddir)/plugin.ext/classes ; \
mkdir -p com/jogamp ; \
cp -a $(NETX_DIR)/com/jogamp/plugin com/jogamp/ ; \
cp -a $(NETX_DIR)/javax . ; \
$(BOOT_DIR)/bin/jar cfm ../plugin3-public.jar \
$(abs_top_builddir)/plugin.manifest \
javax/jnlp com/jogamp/plugin/ui com/jogamp/plugin/applet ) ; \
fi
mkdir -p stamps
touch $@
clean-liveconnect:
rm -rf $(abs_top_builddir)/liveconnect
rm -f stamps/liveconnect-dist.stamp
rm -f liveconnect-source-files.txt
rm -f stamps/liveconnect.stamp
rm -rf $(abs_top_builddir)/plugin.all
rm -rf $(abs_top_builddir)/plugin.ext
# NetX
# requires availability of OpenJDK source code including
# a patch applied to sun.plugin.AppletViewerPanel and generated sources
netx-source-files.txt:
find $(NETX_SRCDIR) -name '*.java' | sort > $@ ; \
for src in $(NETX_EXCLUDE_SRCS) ; \
do \
sed -i "/$${src}/ d" $@ ; \
done
if !WITH_RHINO
sed -i '/RhinoBasedPacEvaluator/ d' $@
endif
if !HAVE_JAVA7
sed -i '/VariableX509TrustManagerJDK7/ d' $@
endif
stamps/netx-html-gen.stamp:
(cd $$NETX_SRCDIR/..; \
mkdir -p html-gen; \
cp AUTHORS NEWS COPYING ChangeLog html-gen/; \
export HTML_GEN_DEBUG=true; \
bash html-gen.sh; \
unset HTML_GEN_DEBUG)
${INSTALL_DATA} $(NETX_SRCDIR)/../html-gen/*.html $(NETX_RESOURCE_DIR)
rm -r $(NETX_SRCDIR)/../html-gen/
mkdir -p stamps
touch $@
stamps/netx.stamp: netx-source-files.txt stamps/bootstrap-directory.stamp stamps/netx-html-gen.stamp
mkdir -p $(NETX_DIR)
$(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \
-d $(NETX_DIR) \
-sourcepath $(NETX_SRCDIR) \
-bootclasspath $(RUNTIME) \
$(NETX_CLASSPATH_ARG) \
@netx-source-files.txt
(cd $(NETX_RESOURCE_DIR); \
for files in $$(find . -type f); \
do \
${INSTALL_DATA} -D $${files} \
$(NETX_DIR)/net/sourceforge/jnlp/resources/$${files}; \
done)
cp -a $(NETX_SRCDIR)/net/sourceforge/jnlp/runtime/pac-funcs.js \
$(NETX_DIR)/net/sourceforge/jnlp/runtime
cp -a build.properties $(NETX_DIR)/net/sourceforge/jnlp/
mkdir -p stamps
touch $@
stamps/netx-dist.stamp: stamps/netx.stamp $(abs_top_builddir)/netx.manifest
(cd $(NETX_DIR) ; \
mkdir -p lib ; \
$(BOOT_DIR)/bin/jar cfm lib/classes.jar \
$(abs_top_builddir)/netx.manifest javax/jnlp net com/jogamp/plugin/ui com/jogamp/plugin/applet jogamp/applet jogamp/plugin/jnlp sun/applet ; \
cp -pPR $(SRC_DIR_LINK) $(NETX_SRCDIR) src; \
find src -type f -exec chmod 640 '{}' ';' -o -type d -exec chmod 750 '{}' ';'; \
cd src ; \
$(ZIP) -qr $(NETX_DIR)/lib/src.zip javax net )
mkdir -p stamps
touch $@
clean-netx:
rm -rf $(NETX_DIR)
rm -f stamps/netx-dist.stamp
rm -f netx-source-files.txt
rm -f stamps/netx.stamp
rm -f stamps/netx-html-gen.stamp
rm -f $(NETX_RESOURCE_DIR)/{NEWS,AUTHORS,COPYING,ChangeLog}.html
clean-desktop-files:
rm -f javaws.desktop
rm -f itweb-settings.desktop
launcher.build/$(javaws): launcher/launchers.in
mkdir -p launcher.build
MAIN_CLASS=net.sourceforge.jnlp.runtime.Boot ;\
BIN_LOCATION=$(bindir)/$(javaws) ;\
PROGRAM_NAME=$(javaws) ;\
$(edit_launcher_script) < $< > $@
launcher.build/$(itweb_settings): launcher/launchers.in
mkdir -p launcher.build
MAIN_CLASS=net.sourceforge.jnlp.controlpanel.CommandLine ;\
BIN_LOCATION=$(bindir)/$(itweb_settings) ;\
PROGRAM_NAME=$(itweb_settings) ;\
$(edit_launcher_script) < $< > $@
clean-launchers:
rm -f launcher.build/$(javaws)
rm -f launcher.build/$(itweb_settings)
if [ -e launcher.build ] ; then \
rmdir launcher.build ; \
fi
javaws.desktop: javaws.desktop.in
sed "s#PATH_TO_JAVAWS#$(bindir)/$(javaws)#" < $(srcdir)/javaws.desktop.in > javaws.desktop
itweb-settings.desktop: $(srcdir)/itweb-settings.desktop.in
sed "s#PATH_TO_ITWEB_SETTINGS#$(bindir)/$(itweb_settings)#" \
< $(srcdir)/itweb-settings.desktop.in > itweb-settings.desktop
# documentation
stamps/docs.stamp: stamps/netx-docs.stamp stamps/plugin-docs.stamp
touch stamps/docs.stamp
clean-docs: clean-netx-docs clean-plugin-docs
if [ -e ${abs_top_builddir}/docs ] ; then \
rmdir ${abs_top_builddir}/docs ; \
fi
rm -f stamps/docs.stamp
stamps/netx-docs.stamp: stamps/bootstrap-directory.stamp
if ENABLE_DOCS
$(BOOT_DIR)/bin/javadoc $(JAVADOC_MEM_OPTS) $(JAVADOC_OPTS) \
-d ${abs_top_builddir}/docs/netx -sourcepath $(NETX_SRCDIR) \
-doctitle 'IcedTea-Web: NetX API Specification' \
-windowtitle 'IcedTea-Web: NetX ' \
-header '<strong>IcedTea-Web<br/>NetX</strong>' \
$(NETX_PKGS)
endif
mkdir -p stamps
touch stamps/netx-docs.stamp
clean-netx-docs:
rm -rf ${abs_top_builddir}/docs/netx
rm -f stamps/netx-docs.stamp
stamps/plugin-docs.stamp: stamps/bootstrap-directory.stamp
if ENABLE_DOCS
if ENABLE_PLUGIN
$(BOOT_DIR)/bin/javadoc $(JAVADOC_MEM_OPTS) $(JAVADOC_OPTS) \
-d ${abs_top_builddir}/docs/plugin -sourcepath $(NETX_SRCDIR):$(LIVECONNECT_SRCS) \
-doctitle 'IcedTea-Web: Plugin API Specification' \
-windowtitle 'IcedTea-Web: Plugin ' \
-header '<strong>IcedTea-Web<br/>Plugin</strong>' \
$(PLUGIN_PKGS)
endif
endif
mkdir -p stamps
touch stamps/plugin-docs.stamp
clean-plugin-docs:
rm -rf ${abs_top_builddir}/docs/plugin
rm -f stamps/plugin-docs.stamp
# check
# ==========================
clean-tests: clean-netx-tests clean-cpp-unit-tests clean-unittest++
if [ -e $(CPP_UNITTEST_DIR) ] ; then \
rmdir $(CPP_UNITTEST_DIR) ; \
fi
if [ -e $(TESTS_DIR) ]; then \
rmdir $(TESTS_DIR) ; \
fi
stamps/check-pac-functions.stamp: stamps/bootstrap-directory.stamp
./jrunscript $(abs_top_srcdir)/tests/netx/pac/pac-funcs-test.js \
$$(readlink -f $(abs_top_srcdir)/netx/net/sourceforge/jnlp/runtime/pac-funcs.js) ; \
mkdir -p stamps && \
touch $@
junit-runner-source-files.txt:
find $(JUNIT_RUNNER_SRCDIR) -name '*.java' | sort > $@
jacoco-operator-source-files.txt:
find $(JACOCO_OPERATOR_SRCDIR) -name '*.java' | sort > $@
$(JUNIT_RUNNER_JAR): junit-runner-source-files.txt stamps/test-extensions-compile.stamp
mkdir -p $(JUNIT_RUNNER_DIR) && \
$(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \
-d $(JUNIT_RUNNER_DIR) \
-classpath $(JUNIT_JAR):$(TEST_EXTENSIONS_DIR) \
@junit-runner-source-files.txt && \
$(BOOT_DIR)/bin/jar cf $@ -C $(JUNIT_RUNNER_DIR) .
stamps/junit-jnlp-dist-dirs: junit-jnlp-dist-simple.txt stamps/junit-jnlp-dist-signed.stamp junit-jnlp-dist-custom.txt
mkdir -p $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)
mkdir -p $(REPRODUCERS_BUILD_DIR)
touch $@
junit-jnlp-dist-custom.txt:
cd $(REPRODUCERS_TESTS_SRCDIR)/$(CUSTOM_REPRODUCERS)/ ; \
find . -maxdepth 1 -mindepth 1 | sed "s/.\/*//" > $(abs_top_builddir)/$@
junit-jnlp-dist-simple.txt:
cd $(REPRODUCERS_TESTS_SRCDIR)/simple/ ; \
find . -maxdepth 1 -mindepth 1 | sed "s/.\/*//" > $(abs_top_builddir)/$@
stamps/junit-jnlp-dist-signed.stamp:
types=($(SIGNED_REPRODUCERS)) ; \
for which in "$${types[@]}" ; do \
pushd $(REPRODUCERS_TESTS_SRCDIR)/$$which/ ; \
find . -maxdepth 1 -mindepth 1 | sed "s/.\/*//" > $(abs_top_builddir)/junit-jnlp-dist-$$which.txt ; \
popd ; \
done ; \
mkdir -p stamps && \
touch $@
stamps/netx-dist-tests-prepare-reproducers.stamp: stamps/junit-jnlp-dist-dirs stamps/liveconnect-dist.stamp stamps/netx-dist.stamp stamps/plugin.stamp
types=($(ALL_NONCUSTOM_REPRODUCERS)); \
for which in "$${types[@]}" ; do \
. $(abs_top_srcdir)/NEW_LINE_IFS ; \
simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \
IFS="$$IFS_BACKUP" ; \
for dir in "$${simpleReproducers[@]}" ; do \
echo "processing: $$dir" ; \
mkdir -p "$(REPRODUCERS_BUILD_DIR)/$$dir" ; \
if [ -e "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/srcs/" ]; then \
d=`pwd` ; \
cd "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/srcs/" ; \
srcFiles=`find . -mindepth 1 -type f -name "*.java" | sed "s/.\/*//"` ; \
notSrcFiles=`find . -mindepth 1 -type f \! -name "*.java" | sed "s/.\/*//"` ; \
$(BOOT_DIR)/bin/javac -cp $(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect -d "$(REPRODUCERS_BUILD_DIR)/$$dir/" $$srcFiles ; \
if [ -n "$$notSrcFiles" ] ; then \
cp -R --parents $$notSrcFiles "$(REPRODUCERS_BUILD_DIR)/$$dir/" ; \
fi ; \
cd "$(REPRODUCERS_BUILD_DIR)/$$dir/" ; \
if [ -f $(META_MANIFEST) ]; \
then \
$(BOOT_DIR)/bin/jar cfm "$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/$$dir.jar" $(META_MANIFEST) * ; \
else \
$(BOOT_DIR)/bin/jar cf "$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/$$dir.jar" * ; \
fi; \
cd "$$d" ; \
fi; \
done ; \
done ; \
mkdir -p stamps && \
touch $@
stamps/netx-dist-tests-sign-some-reproducers.stamp: stamps/netx-dist-tests-prepare-reproducers.stamp
keystore=$(abs_top_builddir)/$(PRIVATE_KEYSTORE_NAME); \
types=($(SIGNED_REPRODUCERS)) ; \
for which in "$${types[@]}" ; do \
tcaw=$(TEST_CERT_ALIAS)_$$which ; \
$(BOOT_DIR)/bin/keytool -genkey -alias $$tcaw -keystore $$keystore -keypass $(PRIVATE_KEYSTORE_PASS) -storepass $(PRIVATE_KEYSTORE_PASS) -dname "cn=$$tcaw, ou=$$tcaw, o=$$tcaw, c=$$tcaw" ; \
. $(abs_top_srcdir)/NEW_LINE_IFS ; \
signedReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \
IFS="$$IFS_BACKUP" ; \
for dir in "$${signedReproducers[@]}" ; do \
$(BOOT_DIR)/bin/jarsigner -keystore $$keystore -storepass $(PRIVATE_KEYSTORE_PASS) -keypass $(PRIVATE_KEYSTORE_PASS) "$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/$$dir.jar" $$tcaw ; \
done ; \
done ; \
mkdir -p stamps && \
touch $@
stamps/change-dots-to-paths.stamp: stamps/netx-dist-tests-sign-some-reproducers.stamp
pushd $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR); \
types=($(ALL_NONCUSTOM_REPRODUCERS)); \
for which in "$${types[@]}" ; do \
. $(abs_top_srcdir)/NEW_LINE_IFS ; \
simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \
IFS="$$IFS_BACKUP" ; \
for dir in "$${simpleReproducers[@]}" ; do \
if test "$${dir:0:1}" = "." ; then \
echo "reproducer $$dir starts with dot. It is forbidden" ; \
exit 5; \
fi; \
if test "$${dir:(-1)}" = "." ; then \
echo "reproducer $$dir ends with dot. It is forbidden" ; \
exit 5; \
fi; \
q=`expr index "$$dir" .`; \
r=$$? ; \
if [ $$r = 0 ]; then \
slashed_dir="./$${dir//.//}" ; \
path="`dirname $$slashed_dir`" ; \
file="`basename $$slashed_dir`.jar" ; \
echo "copying $$dir.jar to $$path as $$file" ; \
mkdir --parents $$path ; \
cp $$dir".jar" "$$path"/"$$file" ; \
fi ; \
done ; \
done ; \
popd ; \
mkdir -p stamps && \
touch $@
#this always tries to remove previous testcert
#the code is copypasted from netx-dist-tests-remove-cert-from-public, because
#with depending to not stamped target we always have to rerun reproducers targets
stamps/exported-test-certs.stamp: stamps/change-dots-to-paths.stamp
-types=($(SIGNED_REPRODUCERS)) ; \
PUBLIC_KEYSTORE=$$XDG_CONFIG_HOME ; \
if test "x$$PUBLIC_KEYSTORE" = x; then \
PUBLIC_KEYSTORE=${HOME}/.config ; \
fi ;\
PUBLIC_KEYSTORE=$$PUBLIC_KEYSTORE/$(PUBLIC_KEYSTORE_STUB); \
for which in "$${types[@]}" ; do \
$(BOOT_DIR)/bin/keytool -delete -alias $(TEST_CERT_ALIAS)_$$which -keystore $$PUBLIC_KEYSTORE -storepass $(PUBLIC_KEYSTORE_PASS) ; \
done ;
types=($(SIGNED_REPRODUCERS)) ; \
for which in "$${types[@]}" ; do \
$(BOOT_DIR)/bin/keytool -export -alias $(TEST_CERT_ALIAS)_$$which -file $(EXPORTED_TEST_CERT_PREFIX)_$$which.$(EXPORTED_TEST_CERT_SUFFIX) -storepass $(PRIVATE_KEYSTORE_PASS) -keystore $(PRIVATE_KEYSTORE_NAME) ; \
done ;
mkdir -p stamps && \
touch $@
stamps/netx-dist-tests-import-cert-to-public: stamps/exported-test-certs.stamp
types=($(SIGNED_REPRODUCERS)) ; \
PUBLIC_KEYSTORE=$$XDG_CONFIG_HOME ; \
if test "x$$PUBLIC_KEYSTORE" = x; then \
PUBLIC_KEYSTORE=${HOME}/.config ; \
fi ;\
PUBLIC_KEYSTORE=$$PUBLIC_KEYSTORE/$(PUBLIC_KEYSTORE_STUB); \
for which in "$${types[@]}" ; do \
yes | $(BOOT_DIR)/bin/keytool -import -alias $(TEST_CERT_ALIAS)_$$which -keystore $$PUBLIC_KEYSTORE -storepass $(PUBLIC_KEYSTORE_PASS) -file $(EXPORTED_TEST_CERT_PREFIX)_$$which.$(EXPORTED_TEST_CERT_SUFFIX) ;\
done ;
mkdir -p stamps && \
touch $@
netx-dist-tests-remove-cert-from-public:
-types=($(SIGNED_REPRODUCERS)) ; \
PUBLIC_KEYSTORE=$$XDG_CONFIG_HOME ; \
if test "x$$PUBLIC_KEYSTORE" = x; then \
PUBLIC_KEYSTORE=${HOME}/.config ; \
fi ;\
PUBLIC_KEYSTORE=$$PUBLIC_KEYSTORE/$(PUBLIC_KEYSTORE_STUB); \
for which in "$${types[@]}" ; do \
$(BOOT_DIR)/bin/keytool -delete -alias $(TEST_CERT_ALIAS)_$$which -keystore $$PUBLIC_KEYSTORE -storepass $(PUBLIC_KEYSTORE_PASS) ; \
done ;
-rm -rf stamps/netx-dist-tests-import-cert-to-public
test-extensions-source-files.txt:
find $(TEST_EXTENSIONS_SRCDIR) -name '*.java' | sort > $@
stamps/test-extensions-compile.stamp: stamps/netx-dist.stamp stamps/plugin.stamp stamps/junit-jnlp-dist-dirs test-extensions-source-files.txt
mkdir -p $(TEST_EXTENSIONS_DIR);
mkdir -p $(NETX_TEST_DIR);
ln -s $(TEST_EXTENSIONS_DIR) $(TEST_EXTENSIONS_COMPATIBILITY_SYMLINK);
$(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \
-d $(TEST_EXTENSIONS_DIR) \
-classpath $(JUNIT_JAR):$(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect/lib/classes.jar \
@test-extensions-source-files.txt && \
mkdir -p stamps && \
touch $@
test-extensions-tests-source-files.txt:
find $(TEST_EXTENSIONS_TESTS_SRCDIR) -name '*.java' | sort > $@
stamps/test-extensions-tests-compile.stamp: stamps/junit-jnlp-dist-dirs test-extensions-tests-source-files.txt stamps/test-extensions-compile.stamp
mkdir -p $(TEST_EXTENSIONS_TESTS_DIR);
$(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \
-d $(TEST_EXTENSIONS_TESTS_DIR) \
-classpath $(JUNIT_JAR):$(NETX_DIR)/lib/classes.jar:$(TEST_EXTENSIONS_DIR) \
@test-extensions-tests-source-files.txt && \
mkdir -p stamps && \
touch $@
stamps/compile-reproducers-testcases.stamp: stamps/netx-dist.stamp stamps/plugin.stamp stamps/junit-jnlp-dist-dirs \
test-extensions-source-files.txt stamps/test-extensions-compile.stamp stamps/test-extensions-tests-compile.stamp
types=($(ALL_REPRODUCERS)); \
for which in "$${types[@]}" ; do \
. $(abs_top_srcdir)/NEW_LINE_IFS ; \
simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \
IFS="$$IFS_BACKUP" ; \
for dir in "$${simpleReproducers[@]}" ; do \
$(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \
-d $(TEST_EXTENSIONS_TESTS_DIR) \
-classpath $(JUNIT_JAR):$(NETX_DIR)/lib/classes.jar:$(TEST_EXTENSIONS_DIR) \
"$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/"*.java ; \
if [ -d "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases" ]; then \
pushd "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases" ; \
NONJAVA_RESOURCES=`ls | grep -v ".*\\.java$$"` ; \
if [ -n "$$NONJAVA_RESOURCES" ]; then \
cp $$NONJAVA_RESOURCES $(TEST_EXTENSIONS_TESTS_DIR)/ ; \
fi ; \
popd ; \
fi ; \
done ; \
done ; \
mkdir -p stamps && \
touch $@
stamps/copy-reproducers-resources.stamp: stamps/junit-jnlp-dist-dirs
types=($(ALL_REPRODUCERS)); \
for which in "$${types[@]}" ; do \
. $(abs_top_srcdir)/NEW_LINE_IFS ; \
simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \
IFS="$$IFS_BACKUP" ; \
for dir in "$${simpleReproducers[@]}" ; do \
cp -R "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/resources/"* $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/ ; \
done ; \
done ; \
mkdir -p stamps && \
touch $@
$(REPRODUCERS_CLASS_NAMES): $(REPRODUCERS_CLASS_WHITELIST)
whiteListed=`cat $(REPRODUCERS_CLASS_WHITELIST)`; \
cd $(TEST_EXTENSIONS_TESTS_DIR) ; \
class_names= ; \
for test in `find -type f` ; do \
class_name=`echo $$test | sed -e 's|\.class$$||' -e 's|^\./||'` ; \
class_name=`echo $$class_name | sed -e 's|/|.|g' ` ; \
INLCUDE="NO" ; \
for x in $$whiteListed ; do \
q=`expr match "$$class_name" "$$x"`; \
r=$$? ; \
if [ $$r = 0 ]; then \
echo "$$class_name will be included in reproducers testcases because of $$x pattern in $(REPRODUCERS_CLASS_WHITELIST). Matching was $$q"; \
INLCUDE="YES" ; \
fi; \
done; \
if [ "$$INLCUDE" = "YES" ]; then \
class_names="$$class_names $$class_name" ; \
else \
echo "$$class_name had no match in $(REPRODUCERS_CLASS_WHITELIST). Excluding"; \
fi; \
done ; \
echo $$class_names > $(REPRODUCERS_CLASS_NAMES)
$(TESTS_DIR)/$(SOFTKILLER):
cd $(TESTS_SRCDIR)/$(SOFTKILLER); \
$(MAKE) ; \
mv $(SOFTKILLER) $(TESTS_DIR)/
stamps/run-netx-dist-tests.stamp: stamps/netx-dist.stamp stamps/plugin.stamp launcher.build/$(javaws) \
javaws.desktop stamps/docs.stamp launcher.build/$(itweb_settings) itweb-settings.desktop \
stamps/netx.stamp stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public $(TESTS_DIR)/softkiller \
stamps/test-extensions-compile.stamp stamps/compile-reproducers-testcases.stamp $(JUNIT_RUNNER_JAR) stamps/copy-reproducers-resources.stamp\
$(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(REPRODUCERS_CLASS_NAMES) stamps/process-custom-reproducers.stamp
cd $(TEST_EXTENSIONS_DIR) ; \
class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \
CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_TESTS_DIR):$(TEST_EXTENSIONS_SRCDIR) \
$(BOOT_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \
-Xbootclasspath:$(RUNTIME) CommandLine $$class_names
if WITH_XSLTPROC
-$(XSLTPROC) --stringparam logs logs_reproducers.html $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl $(TEST_EXTENSIONS_DIR)/tests-output.xml > $(TESTS_DIR)/index_reproducers.html
-$(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/logs.xsl $(TEST_EXTENSIONS_DIR)/ServerAccess-logs.xml > $(TESTS_DIR)/logs_reproducers.html
-$(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/textreport.xsl $(TEST_EXTENSIONS_DIR)/tests-output.xml > $(TESTS_DIR)/summary_reproducers.txt
endif
touch $@
stamps/process-custom-reproducers.stamp: stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public \
stamps/test-extensions-compile.stamp stamps/compile-reproducers-testcases.stamp $(JUNIT_RUNNER_JAR) stamps/copy-reproducers-resources.stamp\
$(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(REPRODUCERS_CLASS_NAMES)
. $(abs_top_srcdir)/NEW_LINE_IFS ; \
customReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-custom.txt `); \
IFS="$$IFS_BACKUP" ; \
for dir in "$${customReproducers[@]}" ; do \
pushd $(REPRODUCERS_TESTS_SRCDIR)/$(CUSTOM_REPRODUCERS)/$$dir/srcs; \
$(MAKE) prepare-reproducer ; \
popd ; \
done ; \
mkdir -p stamps && \
touch $@
clean-custom-reproducers: junit-jnlp-dist-custom.txt
. $(abs_top_srcdir)/NEW_LINE_IFS ; \
customReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-custom.txt `); \
IFS="$$IFS_BACKUP" ; \
for dir in "$${customReproducers[@]}" ; do \
pushd $(REPRODUCERS_TESTS_SRCDIR)/custom/$$dir/srcs; \
$(MAKE) clean-reproducer ; \
popd ; \
done ; \
rm -f stamps/process-custom-reproducers.stamp
#for global-links you must be root, for opera there do not exists user-links
#although this targets will indeed create symbolic links to enable
#icedtea-web plugin inside browser it is intended for testing purposes
if ENABLE_PLUGIN
stamps/user-links.stamp: stamps/netx-dist.stamp stamps/plugin.stamp \
launcher.build/$(javaws) stamps/netx.stamp $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY)
if [ $(MOZILLA_FAMILY_TEST) ] ; then \
if [ -e $(MOZILLA_LOCAL_PLUGINDIR)/$(PLUGIN_LINK_NAME) ] ; then \
mv -f $(MOZILLA_LOCAL_PLUGINDIR)/$(PLUGIN_LINK_NAME) $(MOZILLA_LOCAL_BACKUP_FILE) ; \
echo "$(MOZILLA_LOCAL_PLUGINDIR)/$(PLUGIN_LINK_NAME) backed up as $(MOZILLA_LOCAL_BACKUP_FILE)" ; \
else \
echo "$(MOZILLA_LOCAL_PLUGINDIR)/$(PLUGIN_LINK_NAME) doesn't exists, nothing to be backed up to $(MOZILLA_LOCAL_BACKUP_FILE)" ; \
fi ; \
pushd $(MOZILLA_LOCAL_PLUGINDIR) ; \
ln -s $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) $(PLUGIN_LINK_NAME) ; \
echo "$(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) linked as $$PWD/$(PLUGIN_LINK_NAME)" ; \
popd ; \
fi ; \
touch $@
restore-user-links:
if [ $(MOZILLA_FAMILY_TEST) ] ; then \
if [ -e $(MOZILLA_LOCAL_BACKUP_FILE) ] ; then \
mv -f $(MOZILLA_LOCAL_BACKUP_FILE) $(MOZILLA_LOCAL_PLUGINDIR)/$(PLUGIN_LINK_NAME) ; \
echo "$(MOZILLA_LOCAL_BACKUP_FILE) restored as $(MOZILLA_LOCAL_PLUGINDIR)/$(PLUGIN_LINK_NAME)" ; \
else \
rm -f $(MOZILLA_LOCAL_PLUGINDIR)/$(PLUGIN_LINK_NAME) ; \
echo "$(MOZILLA_LOCAL_BACKUP_FILE) do not exists, nothing to be restored. $(MOZILLA_LOCAL_PLUGINDIR)/$(PLUGIN_LINK_NAME) removed" ; \
fi ; \
fi ;
if [ -e stamps/user-links.stamp ] ; then \
rm -f stamps/user-links.stamp ; \
fi
stamps/global-links.stamp: stamps/netx-dist.stamp stamps/plugin.stamp launcher.build/$(javaws) \
stamps/netx.stamp $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY)
if [ $(MOZILLA_FAMILY_TEST) ] ; then \
dir="$(MOZILLA_GLOBAL32_PLUGINDIR)" ; \
arch=`arch` ; \
if [ "$$arch" = "x86_64" ] ; then \
dir="$(MOZILLA_GLOBAL64_PLUGINDIR)" ; \
fi ; \
if [ -e "$$dir"/$(PLUGIN_LINK_NAME) ] ; then \
mv -f "$$dir"/$(PLUGIN_LINK_NAME) $(MOZILLA_GLOBAL_BACKUP_FILE) ; \
echo "$$dir/$(PLUGIN_LINK_NAME) backed up as $(MOZILLA_GLOBAL_BACKUP_FILE)" ; \
else \
echo "$$dir/$(PLUGIN_LINK_NAME) do not exists, nothing to be backed up to $(MOZILLA_GLOBAL_BACKUP_FILE)" ; \
fi ; \
pushd "$$dir" ; \
ln -s $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) $(PLUGIN_LINK_NAME) ; \
echo "$(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) linked as $$PWD/$(PLUGIN_LINK_NAME)" ; \
popd ; \
fi ;
if [ "$(OPERA)" != "" ] ; then \
dir="$(OPERA_GLOBAL32_PLUGINDIR)" ; \
arch=`arch` ; \
if [ "$$arch" = "x86_64" ] ; then \
dir="$(OPERA_GLOBAL64_PLUGINDIR)" ; \
fi ; \
if [ -e "$$dir"/$(PLUGIN_LINK_NAME) ] ; then \
mv -f "$$dir"/$(PLUGIN_LINK_NAME) $(OPERA_GLOBAL_BACKUP_FILE) ; \
echo "$$dir/$(PLUGIN_LINK_NAME) backed up as $(OPERA_GLOBAL_BACKUP_FILE) "; \
else \
echo "$$dir/$(PLUGIN_LINK_NAME) do not exists, nothing to be backed up to $(OPERA_GLOBAL_BACKUP_FILE) "; \
fi ; \
pushd "$$dir" ; \
ln -s $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) $(PLUGIN_LINK_NAME) ; \
echo "$(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) linked as $$PWD/$(PLUGIN_LINK_NAME)" ; \
popd ; \
fi ; \
touch $@
restore-global-links:
if [ $(MOZILLA_FAMILY_TEST) ] ; then \
dir="$(MOZILLA_GLOBAL32_PLUGINDIR)" ; \
arch=`arch` ; \
if [ "$$arch" = "x86_64" ] ; then \
dir="$(MOZILLA_GLOBAL64_PLUGINDIR)" ; \
fi ; \
if [ -e $(MOZILLA_GLOBAL_BACKUP_FILE) ] ; then \
mv -f $(MOZILLA_GLOBAL_BACKUP_FILE) "$$dir"/$(PLUGIN_LINK_NAME) ; \
echo "$(MOZILLA_GLOBAL_BACKUP_FILE) restored as $$dir/$(PLUGIN_LINK_NAME)" ; \
else \
rm -f "$$dir"/$(PLUGIN_LINK_NAME) ; \
echo "$(MOZILLA_GLOBAL_BACKUP_FILE) do not exists, nothing to be restored. $$dir/$(PLUGIN_LINK_NAME) removed" ; \
fi ; \
fi ;
if [ "$(OPERA)" != "" ] ; then \
dir="$(OPERA_GLOBAL32_PLUGINDIR)" ; \
arch=`arch` ; \
if [ "$$arch" = "x86_64" ] ; then \
dir="$(OPERA_GLOBAL64_PLUGINDIR)" ; \
fi ; \
if [ -e $(OPERA_GLOBAL_BACKUP_FILE) ] ; then \
mv -f $(OPERA_GLOBAL_BACKUP_FILE) "$$dir"/$(PLUGIN_LINK_NAME) ; \
echo "$(OPERA_GLOBAL_BACKUP_FILE) restored as $$dir/$(PLUGIN_LINK_NAME)" ; \
else \
rm -f "$$dir"/$(PLUGIN_LINK_NAME) ; \
echo "$(OPERA_GLOBAL_BACKUP_FILE) do not exist, nothing to be restored. $$dir/$(PLUGIN_LINK_NAME) removed" ; \
fi ; \
fi ;
if [ -e stamps/global-links.stamp ] ; then \
rm -f stamps/global-links.stamp ; \
fi
endif
netx-unit-tests-source-files.txt:
find $(NETX_UNIT_TEST_SRCDIR) -name '*.java' | sort > $@
stamps/netx-unit-tests-compile.stamp: stamps/netx.stamp \
netx-unit-tests-source-files.txt stamps/test-extensions-compile.stamp
mkdir -p $(NETX_UNIT_TEST_DIR) && \
$(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \
-d $(NETX_UNIT_TEST_DIR) \
-classpath $(JUNIT_JAR):$(abs_top_builddir)/liveconnect/lib/classes.jar:$(NETX_DIR)/lib/classes.jar:$(TEST_EXTENSIONS_DIR):$(TAGSOUP_JAR) \
@netx-unit-tests-source-files.txt && \
mkdir -p stamps && \
touch $@
$(TESTS_DIR)/$(REPORT_STYLES_DIRNAME):
mkdir $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME)
cp $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/*.css $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME)/
cp $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/*.js $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME)/
$(UNIT_CLASS_NAMES):
cd $(NETX_UNIT_TEST_DIR) ; \
class_names= ; \
for test in `find -type f` ; do \
class_name=`echo $$test | sed -e 's|\.class$$||' -e 's|^\./||'` ; \
class_name=`echo $$class_name | sed -e 's|/|.|g' ` ; \
class_names="$$class_names $$class_name" ; \
done ; \
echo $$class_names > $(UNIT_CLASS_NAMES);
stamps/run-netx-unit-tests.stamp: stamps/netx-unit-tests-compile.stamp $(JUNIT_RUNNER_JAR) \
$(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(UNIT_CLASS_NAMES)
filename=" " ; \
cd $(NETX_UNIT_TEST_SRCDIR) ; \
for file in `find . -type f \! -iname "*.java"`; do\
filename=`echo $$file `; \
cp --parents $$filename $(NETX_UNIT_TEST_DIR) ; \
done ; \
cd $(NETX_UNIT_TEST_DIR) ; \
class_names=`cat $(UNIT_CLASS_NAMES)` ; \
CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):.:$(TEST_EXTENSIONS_SRCDIR):$(TAGSOUP_JAR) \
$(BOOT_DIR)/bin/java -Xbootclasspath:$(RUNTIME) CommandLine $$class_names
if WITH_XSLTPROC
-$(XSLTPROC) --stringparam logs logs_unit.html $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl $(NETX_UNIT_TEST_DIR)/tests-output.xml > $(TESTS_DIR)/index_unit.html
-$(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/logs.xsl $(NETX_UNIT_TEST_DIR)/ServerAccess-logs.xml > $(TESTS_DIR)/logs_unit.html
-$(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/textreport.xsl $(NETX_UNIT_TEST_DIR)/tests-output.xml > $(TESTS_DIR)/summary_unit.txt
endif
mkdir -p stamps && \
touch $@
#warning, during this target tests.build/netx/unit/tests-output.xml is backup and rewriten (but not coresponding html file)
#xml results run from emma sandbox, however, can be wrong, co the new tests-output.xml is then renamed and orginal one restored
#you can add -ix "-*Test*" -ix "-*test*" to ignore all test cases from statistics
stamps/run-unit-test-code-coverage.stamp: stamps/netx-unit-tests-compile.stamp $(JUNIT_RUNNER_JAR) \
$(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(UNIT_CLASS_NAMES)
if WITH_EMMA
cd $(NETX_UNIT_TEST_DIR) ; \
for file in $(EMMA_MODIFIED_FILES) ; do \
mv $(NETX_UNIT_TEST_DIR)/$$file $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" ; \
done ;\
class_names=`cat $(UNIT_CLASS_NAMES)` ; \
$(BOOT_DIR)/bin/java $(EMMA_JAVA_ARGS) -Xbootclasspath:$(RUNTIME) -cp $(EMMA_JAR) -Demma.report.html.out.encoding=UTF-8 emmarun \
-Dreport.html.out.encoding=UTF-8 \
-raw \
-sp $(NETX_SRCDIR) \
-sp $(NETX_UNIT_TEST_SRCDIR) \
-sp $(JUNIT_RUNNER_SRCDIR) \
-r html \
-r xml \
-cp $(NETX_DIR)/lib/classes.jar \
-cp $(JUNIT_JAR) \
-cp $(JUNIT_RUNNER_JAR) \
-cp $(BOOT_DIR)/jre/lib/rt.jar \
-cp $(BOOT_DIR)/jre/lib/jsse.jar \
-cp $(BOOT_DIR)/jre/lib/resources.jar \
-cp $(RHINO_RUNTIME) \
-cp $(TEST_EXTENSIONS_DIR) \
-cp $(TEST_EXTENSIONS_SRCDIR) \
if HAVE_TAGSOUP
-cp $(TAGSOUP_JAR) \
endif
-cp . \
-ix "-org.junit.*" \
-ix "-junit.*" \
CommandLine $$class_names ; \
for file in $(EMMA_MODIFIED_FILES) ; do \
mv $(NETX_UNIT_TEST_DIR)/$$file $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_SUFFIX)" ; \
mv $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" $(NETX_UNIT_TEST_DIR)/$$file ; \
done ;
else
echo "Sorry, coverage report cant be run without emma installed. Try install emma or specify with-emma value" ;
exit 5
endif
touch $@
stamps/compile-jacoco-operator.stamp: jacoco-operator-source-files.txt
if WITH_JACOCO
mkdir -p $(JACOCO_OPERATOR_DIR) && \
$(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \
-d $(JACOCO_OPERATOR_DIR) \
-classpath $(JACOCO_CLASSPATH) \
@jacoco-operator-source-files.txt ;
else
echo "Sorry, jacoco coverage report generator cant be compiled without jacoco installed. Try installing jacoco or specify with-jacoco value" ;
exit 5
endif
touch $@
#warning, during this target tests.build/netx/unit/tests-output.xml is backup and rewriten (but not coresponding html file)
#xml results run with jacoco agent however, can be wrong, co the new tests-output.xml is then renamed and orginal one restored
stamps/run-unit-test-code-coverage-jacoco.stamp: stamps/netx-unit-tests-compile.stamp $(JUNIT_RUNNER_JAR) \
$(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(UNIT_CLASS_NAMES) stamps/compile-jacoco-operator.stamp
if WITH_JACOCO
filename=" " ; \
cd $(NETX_UNIT_TEST_SRCDIR) ; \
for file in `find . -type f \! -iname "*.java"`; do\
filename=`echo $$file `; \
cp --parents $$filename $(NETX_UNIT_TEST_DIR) ; \
done ; \
cd $(NETX_UNIT_TEST_DIR) ; \
for file in $(EMMA_MODIFIED_FILES) ; do \
mv $(NETX_UNIT_TEST_DIR)/$$file $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" ; \
done ;\
class_names=`cat $(UNIT_CLASS_NAMES)` ; \
CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):$(JACOCO_CLASSPATH):.:$(TEST_EXTENSIONS_SRCDIR):$(TAGSOUP_JAR) \
$(BOOT_DIR)/bin/java $(JACOCO_AGENT_SWITCH) -Xbootclasspath:$(RUNTIME) CommandLine $$class_names ; \
for file in $(EMMA_MODIFIED_FILES) ; do \
mv $(NETX_UNIT_TEST_DIR)/$$file $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_SUFFIX)" ; \
mv $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" $(NETX_UNIT_TEST_DIR)/$$file ; \
done ; \
$(JACOCO_OPERATOR_EXEC) \
report --die-soon --html-output coverage --xml-output coverage.xml --input-file jacoco.exec \
--input-srcs $(NETX_SRCDIR) $(PLUGIN_SRCDIR)/java $(NETX_UNIT_TEST_SRCDIR) $(JUNIT_RUNNER_SRCDIR) $(TEST_EXTENSIONS_SRCDIR) \
--input-builds $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar $(NETX_UNIT_TEST_DIR) $(JUNIT_RUNNER_JAR) $(TEST_EXTENSIONS_DIR) \
--title "IcedTea-Web unit-tests codecoverage" ;
else
echo "Sorry, coverage report cant be run without jacoco installed. Try installing jacoco or specify with-jacoco value" ;
exit 5
endif
touch $@
#warning, during this target tests.build/netx/jnlp_testsengine/tests-output.xml is backup and rewriten (but not coresponding html file)
#xml results run from emma sandbox, however, can be wrong, co the new tests-output.xml is then renamed and orginal one restored
stamps/run-reproducers-test-code-coverage.stamp: stamps/run-netx-dist-tests.stamp $(REPRODUCERS_CLASS_NAMES)
if WITH_EMMA
cd $(TESTS_DIR) ; \
for file in $(EMMA_MODIFIED_FILES) ; do \
mv $(TEST_EXTENSIONS_DIR)/$$file $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" ; \
done ;\
echo "backuping javaws and netx.jar in $(DESTDIR)" ; \
netx_backup=$(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx_backup.jar ; \
javaws_backup=$(DESTDIR)$(bindir)/javaws_backup ; \
mv $(DESTDIR)$(bindir)/javaws $$javaws_backup ; \
mv $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar $$netx_backup ; \
nw_bootclasspath="$(LAUNCHER_BOOTCLASSPATH):$(EMMA_JAR):$$netx_backup" ; \
instructed_dir=$(TESTS_DIR)/instr ; \
echo "instrumenting netx.jar from $$netx_backup through $$instructed_dir" ; \
$(BOOT_DIR)/bin/java -cp $(EMMA_JAR) emma instr -d $$instructed_dir -ip $$netx_backup ; \
pushd $$instructed_dir ; \
$(BOOT_DIR)/bin/jar -cf $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar * ; \
popd ; \
rm -rf $$instructed_dir ; \
echo "patching $(javaws)" ; \
cat $$javaws_backup | sed "s,$(LAUNCHER_BOOTCLASSPATH),$$nw_bootclasspath," > $(DESTDIR)$(bindir)/$(javaws) ; \
chmod 777 $(DESTDIR)$(bindir)/$(javaws) ; \
testcases_srcs=( ) ; \
k=0 ; \
types=($(ALL_REPRODUCERS)); \
for which in "$${types[@]}" ; do \
. $(abs_top_srcdir)/NEW_LINE_IFS ; \
simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \
IFS="$$IFS_BACKUP" ; \
for dir in "$${simpleReproducers[@]}" ; do \
testcases_srcs[k]="-sp" ; \
k=$$((k+1)) ; \
testcases_srcs[k]="$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/" ; \
k=$$((k+1)) ; \
done ; \
done ; \
cd $(TEST_EXTENSIONS_DIR) ; \
class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \
$(BOOT_DIR)/bin/java \
$(EMMA_JAVA_ARGS) \
$(REPRODUCERS_DPARAMETERS) \
-Xbootclasspath:$(RUNTIME) -cp $(EMMA_JAR) emmarun \
-raw \
-cp $(NETX_DIR)/lib/classes.jar \
-cp $(JUNIT_JAR) \
-cp $(JUNIT_RUNNER_JAR) \
-cp $(BOOT_DIR)/jre/lib/rt.jar \
-cp $(BOOT_DIR)/jre/lib/jsse.jar \
-cp $(BOOT_DIR)/jre/lib/resources.jar \
-cp $(RHINO_RUNTIME) \
-cp . \
-cp $(TEST_EXTENSIONS_SRCDIR) \
-cp $(TEST_EXTENSIONS_TESTS_DIR) \
-ix "-org.junit.*" \
-ix "-junit.*" \
CommandLine $$class_names ; \
mv $(TEST_EXTENSIONS_DIR)/coverage.ec $(TEST_EXTENSIONS_DIR)/coverageX.ec ; \
mv $(TEST_EXTENSIONS_DIR)/coverage.es $(TEST_EXTENSIONS_DIR)/coverageX.es ; \
$(BOOT_DIR)/bin/java $(EMMA_JAVA_ARGS) -cp $(EMMA_JAR) emma merge \
-in $(TESTS_DIR)/coverage.em \
-in $(TEST_EXTENSIONS_DIR)/coverageX.ec \
-in $(TEST_EXTENSIONS_DIR)/coverageX.es ; \
$(BOOT_DIR)/bin/java $(EMMA_JAVA_ARGS) -cp $(EMMA_JAR) -Demma.report.html.out.encoding=UTF-8 emma report \
-Dreport.html.out.encoding=UTF-8 \
-in $(TEST_EXTENSIONS_DIR)/coverage.es \
-sp $(NETX_SRCDIR) \
-sp $(NETX_UNIT_TEST_SRCDIR) \
-sp $(JUNIT_RUNNER_SRCDIR) \
-sp $(TEST_EXTENSIONS_SRCDIR) \
-sp $(TEST_EXTENSIONS_TESTS_SRCDIR) \
-r html \
-r xml \
"$${testcases_srcs[@]}" ; \
echo "restoring javaws and netx.jar in $(DESTDIR)" ; \
rm -f $(DESTDIR)$(bindir)/$(javaws) $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar ; \
rm -f $(DESTDIR)$(bindir)/$(javaws); \
mv $$javaws_backup $(DESTDIR)$(bindir)/$(javaws); \
mv $$netx_backup $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar ; \
for file in $(EMMA_MODIFIED_FILES) ; do \
mv $(TEST_EXTENSIONS_DIR)/$$file $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_SUFFIX)" ; \
mv $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" $(TEST_EXTENSIONS_DIR)/$$file ; \
done ;\
rm $(TEST_EXTENSIONS_DIR)/coverage.txt ;
else
echo "Sorry, coverage report cant be run without emma installed. Try install emma or specify with-emma value" ;
exit 5
endif
touch $@
$(COVERABLE_PLUGIN_DIR):
mkdir -p $(COVERABLE_PLUGIN_DIR);
$(COVERABLE_PLUGIN_DIR)/%.o: $(PLUGIN_SRCDIR)/%.cc
cd $(COVERABLE_PLUGIN_DIR) && \
$(CXX) $(CXXFLAGS) \
$(DEFS) $(VERSION_DEFS) \
-DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \
-DPLUGIN_NAME="\"IcedTea-Web Plugin with jacoco coverage agent\"" \
-DPLUGIN_VERSION="\"$(PLUGIN_VERSION)\"" \
-DPACKAGE_URL="\"$(PACKAGE_URL)\"" \
-DMOZILLA_VERSION_COLLAPSED="$(MOZILLA_VERSION_COLLAPSED)" \
-DICEDTEA_WEB_JRE="\"$(SYSTEM_JRE_DIR)\"" \
-DPLUGIN_BOOTCLASSPATH=$(PLUGIN_COVERAGE_BOOTCLASSPATH) \
-DCOVERAGE_AGENT=$(JACOCO_AGENT_PLUGIN_SWITCH) \
$(GLIB_CFLAGS) \
$(MOZILLA_CFLAGS) \
-fvisibility=hidden \
-fPIC -o $@ -c $<
$(COVERABLE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY): $(addprefix $(COVERABLE_PLUGIN_DIR)/,$(PLUGIN_OBJECTS))
cd $(COVERABLE_PLUGIN_DIR) && \
$(CXX) $(CXXFLAGS) \
$(PLUGIN_OBJECTS) \
$(GLIB_LIBS) \
$(MOZILLA_LIBS) \
-shared -o $@
stamps/build-fake-plugin.stamp: $(COVERABLE_PLUGIN_DIR) $(addprefix $(PLUGIN_SRCDIR)/,$(PLUGIN_SRC)) $(addprefix $(COVERABLE_PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) stamps/liveconnect-dist.stamp $(COVERABLE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY)
touch $@
#warning, during this target tests.build/netx/jnlp_testsengine/tests-output.xml is backup and rewriten (but not coresponding html file)
#xml results run with jacoco agent, however, can be wrong, co the new tests-output.xml is then renamed and orginal one restored
stamps/run-reproducers-test-code-coverage-jacoco.stamp: stamps/run-netx-dist-tests.stamp $(REPRODUCERS_CLASS_NAMES) \
stamps/compile-jacoco-operator.stamp stamps/build-fake-plugin.stamp
if WITH_JACOCO
cd $(TESTS_DIR) ; \
for file in $(EMMA_MODIFIED_FILES) ; do \
mv $(TEST_EXTENSIONS_DIR)/$$file $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" ; \
done ;\
echo "backuping javaws in $(DESTDIR)$(bindir)" ; \
javaws_backup=$(DESTDIR)$(bindir)/javaws_backup ; \
mv $(DESTDIR)$(bindir)/javaws $$javaws_backup ; \
echo "patching $(javaws)" ; \
nw_bootclasspath="$(LAUNCHER_BOOTCLASSPATH):$(JACOCO_CLASSPATH)" ; \
cat $$javaws_backup | sed "s|COMMAND.k.=\"..JAVA.\"|COMMAND[k]=\"\\$$\\{JAVA\\}\" ; k=1 ; COMMAND[k]=$(JACOCO_AGENT_JAVAWS_SWITCH)|" | sed "s,$(LAUNCHER_BOOTCLASSPATH),$$nw_bootclasspath," > $(DESTDIR)$(bindir)/$(javaws) ; \
chmod 777 $(DESTDIR)$(bindir)/$(javaws) ; \
echo "backuping plugin in $(DESTDIR)/$(libdir)$(BUILT_PLUGIN_LIBRARY)" ; \
plugin_backup=$(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY)_backup ; \
mv $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) $$plugin_backup ; \
echo "fakeing plugin" ; \
cp $(COVERABLE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) ; \
testcases_srcs=( ) ; \
k=0 ; \
types=($(ALL_REPRODUCERS)); \
for which in "$${types[@]}" ; do \
. $(abs_top_srcdir)/NEW_LINE_IFS ; \
simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \
IFS="$$IFS_BACKUP" ; \
for dir in "$${simpleReproducers[@]}" ; do \
testcases_srcs[k]="$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/" ; \
k=$$((k+1)) ; \
done ; \
done ; \
cd $(TEST_EXTENSIONS_DIR) ; \
class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \
CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_DIR):$(JACOCO_CLASSPATH):$(TEST_EXTENSIONS_TESTS_DIR):$(TEST_EXTENSIONS_SRCDIR) \
$(BOOT_DIR)/bin/java $(JACOCO_AGENT_SWITCH) $(REPRODUCERS_DPARAMETERS) \
-Xbootclasspath:$(RUNTIME) CommandLine $$class_names ; \
if [ -f $(JACOCO_JAVAWS_RESULTS) ] ; then \
jacoco_javaws_results=$(JACOCO_JAVAWS_RESULTS) ; \
$(JACOCO_OPERATOR_EXEC) \
report --die-soon --html-output coverage-javaws --xml-output coverage-javaws.xml --input-file $(JACOCO_JAVAWS_RESULTS) \
--input-srcs $(NETX_SRCDIR) \
--input-builds $(NETX_DIR)/lib/classes.jar \
--title "IcedTea-Web javaws reproducers codecoverage" ; \
fi; \
if [ -f $(JACOCO_PLUGIN_RESULTS) ] ; then \
jacoco_plugin_results=$(JACOCO_PLUGIN_RESULTS) ; \
$(JACOCO_OPERATOR_EXEC) \
report --die-soon --html-output coverage-plugin --xml-output coverage-plugin.xml --input-file $(JACOCO_PLUGIN_RESULTS) \
--input-srcs $(NETX_SRCDIR) $(PLUGIN_SRCDIR)/java \
--input-builds $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar \
--title "IcedTea-Web plugin reproducers codecoverage" ; \
fi; \
$(JACOCO_OPERATOR_EXEC) \
merge --die-soon --input-files jacoco.exec $$jacoco_javaws_results $$jacoco_plugin_results --output-file jacoco-merged-reproducers.exec ; \
$(JACOCO_OPERATOR_EXEC) \
report --html-output coverage --xml-output coverage.xml --input-file jacoco-merged-reproducers.exec \
--input-srcs $(NETX_SRCDIR) $(PLUGIN_SRCDIR)/java $(JUNIT_RUNNER_SRCDIR) $(TEST_EXTENSIONS_SRCDIR) $(TEST_EXTENSIONS_TESTS_SRCDIR) "$${testcases_srcs[@]}" \
--input-builds $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar $(JUNIT_RUNNER_JAR) $(TEST_EXTENSIONS_DIR) $(TEST_EXTENSIONS_TESTS_DIR) \
--title "IcedTea-Web reproducers-tests codecoverage" ; \
echo "restoring javaws in $(DESTDIR)$(bindir)" ; \
rm -f $(DESTDIR)$(bindir)/$(javaws); \
mv $$javaws_backup $(DESTDIR)$(bindir)/$(javaws); \
echo "restoring plugin in $(DESTDIR)/$(libdir)$(BUILT_PLUGIN_LIBRARY)" ; \
mv $$plugin_backup $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) ; \
for file in $(EMMA_MODIFIED_FILES) ; do \
mv $(TEST_EXTENSIONS_DIR)/$$file $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_SUFFIX)" ; \
mv $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" $(TEST_EXTENSIONS_DIR)/$$file ; \
done ;
else
echo "Sorry, coverage report cant be run without jacoco installed. Try installing jacoco or specify with-jacoco value" ;
exit 5
endif
touch $@
run-test-code-coverage-jacoco: stamps/run-unit-test-code-coverage-jacoco.stamp stamps/run-reproducers-test-code-coverage-jacoco.stamp
if WITH_JACOCO
cd $(TESTS_DIR) ; \
k=0 ; \
types=($(ALL_REPRODUCERS)); \
for which in "$${types[@]}" ; do \
. $(abs_top_srcdir)/NEW_LINE_IFS ; \
simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \
IFS="$$IFS_BACKUP" ; \
for dir in "$${simpleReproducers[@]}" ; do \
testcases_srcs[k]="$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/" ; \
k=$$((k+1)) ; \
done ; \
done ; \
class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \
$(JACOCO_OPERATOR_EXEC) \
merge --die-soon --input-files $(TEST_EXTENSIONS_DIR)/jacoco-merged-reproducers.exec $(NETX_UNIT_TEST_DIR)/jacoco.exec --output-file jacoco-merged.exec; \
$(JACOCO_OPERATOR_EXEC) \
report --html-output coverage --xml-output coverage.xml --input-file jacoco-merged.exec \
--input-srcs $(NETX_SRCDIR) $(PLUGIN_SRCDIR)/java $(JUNIT_RUNNER_SRCDIR) $(TEST_EXTENSIONS_SRCDIR) $(TEST_EXTENSIONS_TESTS_SRCDIR) "$${testcases_srcs[@]}" \
--input-builds $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar $(JUNIT_RUNNER_JAR) $(TEST_EXTENSIONS_DIR) $(TEST_EXTENSIONS_TESTS_DIR) \
--input-srcs $(NETX_UNIT_TEST_SRCDIR) \
--input-builds $(NETX_UNIT_TEST_DIR) \
--title "IcedTea-Web complete codecoverage" ;
else
echo "Sorry, coverage report cant be run without jacoco installed. Try installing jacoco or specify with-jacoco value" ;
exit 5
endif
run-test-code-coverage: stamps/run-unit-test-code-coverage.stamps stamps/run-reproducers-test-code-coverage.stamps
if WITH_EMMA
cd $(TESTS_DIR) ; \
k=0 ; \
types=($(ALL_REPRODUCERS)); \
for which in "$${types[@]}" ; do \
. $(abs_top_srcdir)/NEW_LINE_IFS ; \
simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \
IFS="$$IFS_BACKUP" ; \
for dir in "$${simpleReproducers[@]}" ; do \
testcases_srcs[k]="-sp" ; \
k=$$((k+1)) ; \
testcases_srcs[k]="$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/" ; \
k=$$((k+1)) ; \
done ; \
done ; \
$(BOOT_DIR)/bin/java $(EMMA_JAVA_ARGS) -cp $(EMMA_JAR) emma merge \
-in $(NETX_UNIT_TEST_DIR)/coverage.es \
-in $(TEST_EXTENSIONS_DIR)/coverage.es ; \
$(BOOT_DIR)/bin/java $(EMMA_JAVA_ARGS) -cp $(EMMA_JAR) -Demma.report.html.out.encoding=UTF-8 emma report \
-Dreport.html.out.encoding=UTF-8 \
-in $(TESTS_DIR)/coverage.es \
-in $(TESTS_DIR)/coverage.em \
-sp $(NETX_SRCDIR) \
-sp $(NETX_UNIT_TEST_SRCDIR) \
-sp $(JUNIT_RUNNER_SRCDIR) \
-sp $(TEST_EXTENSIONS_SRCDIR) \
-sp $(TEST_EXTENSIONS_TESTS_SRCDIR) \
"$${testcases_srcs[@]}" \
-r html \
-r xml ;
else
echo "Sorry, coverage report cant be run without emma installed. Try install emma or specify with-emma value" ;
exit 5
endif
run-test-server-on-44321: stamps/netx.stamp stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public \
stamps/test-extensions-compile.stamp stamps/compile-reproducers-testcases.stamp $(JUNIT_RUNNER_JAR) stamps/copy-reproducers-resources.stamp
cd $(TEST_EXTENSIONS_DIR) ; \
CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_TESTS_DIR) \
$(BOOT_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \
-Xbootclasspath:$(RUNTIME) net.sourceforge.jnlp.ServerAccess
run-test-server-on-random-port: stamps/netx.stamp stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public \
stamps/test-extensions-compile.stamp stamps/compile-reproducers-testcases.stamp $(JUNIT_RUNNER_JAR) stamps/copy-reproducers-resources.stamp
cd $(TEST_EXTENSIONS_DIR) ; \
CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_TESTS_DIR) \
$(BOOT_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \
-Xbootclasspath:$(RUNTIME) net.sourceforge.jnlp.ServerAccess randomport
clean-netx-tests: clean-netx-unit-tests clean-junit-runner clean-netx-dist-tests clean-test-code-coverage-jacoco clean-test-code-coverage
if [ -e $(TESTS_DIR)/netx ]; then \
rmdir $(TESTS_DIR)/netx ; \
fi
clean-junit-runner:
rm -f junit-runner-source-files.txt
rm -rf $(JUNIT_RUNNER_DIR)
rm -f $(JUNIT_RUNNER_JAR)
clean-netx-unit-tests: clean_tests_reports
rm -f netx-unit-tests-source-files.txt
rm -rf $(NETX_UNIT_TEST_DIR)
rm -f $(UNIT_CLASS_NAMES)
rm -f stamps/check-pac-functions.stamp
rm -f stamps/run-netx-unit-tests.stamp
rm -f stamps/netx-unit-tests-compile.stamp
clean_tests_reports:
rm -rf $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME)/
rm -f $(TESTS_DIR)/*.html
rm -f $(TESTS_DIR)/summary_unit.txt
rm -f $(TESTS_DIR)/summary_reproducers.txt
clean-$(SOFTKILLER):
rm -f $(TESTS_DIR)/softkiller
clean-netx-dist-tests: clean_tests_reports netx-dist-tests-remove-cert-from-public clean-custom-reproducers clean-$(SOFTKILLER)
rm -f test-extensions-source-files.txt
rm -f test-extensions-tests-source-files.txt
rm -f $(TEST_EXTENSIONS_COMPATIBILITY_SYMLINK)
rm -rf $(TEST_EXTENSIONS_TESTS_DIR)
rm -rf $(REPRODUCERS_BUILD_DIR)
rm -rf $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)
rm -rf $(TEST_EXTENSIONS_DIR)
rm -f stamps/junit-jnlp-dist-dirs
rm -f stamps/test-extensions-compile.stamp
rm -f stamps/test-extensions-tests-compile.stamp
rm -f stamps/netx-dist-tests-prepare-reproducers.stamp
rm -f stamps/compile-reproducers-testcases.stamp
rm -f stamps/copy-reproducers-resources.stamp
rm -f stamps/netx-dist-tests-sign-some-reproducers.stamp
rm -f stamps/change-dots-to-paths.stamp
rm -f junit-jnlp-dist-simple.txt
rm -f junit-jnlp-dist-custom.txt
rm -f netx-dist-tests-tests-source-files.txt
types=($(SIGNED_REPRODUCERS)) ; \
for which in "$${types[@]}" ; do \
rm -f junit-jnlp-dist-$$which.txt ; \
rm -f $(EXPORTED_TEST_CERT_PREFIX)_$$which.$(EXPORTED_TEST_CERT_SUFFIX) ; \
done ;
rm -f stamps/exported-test-certs.stamp
rm -f stamps/junit-jnlp-dist-signed.stamp
rm -f $(REPRODUCERS_CLASS_NAMES)
rm -f $(abs_top_builddir)/$(PRIVATE_KEYSTORE_NAME)
rm -f stamps/run-netx-dist-tests.stamp
clean-unit-test-code-coverage:
if [ -e stamps/run-unit-test-code-coverage.stamp ]; then \
rm -rf $(NETX_UNIT_TEST_DIR)/coverage ; \
rm -f $(NETX_UNIT_TEST_DIR)/coverage.xml ; \
rm -f $(NETX_UNIT_TEST_DIR)/coverageX.es ; \
rm -f $(NETX_UNIT_TEST_DIR)/coverageX.ec ; \
rm -f $(NETX_UNIT_TEST_DIR)/coverage.es ; \
rm -f $(NETX_UNIT_TEST_DIR)/tests-output_withEmma.xml ; \
rm -f stamps/run-unit-test-code-coverage.stamp ; \
fi
clean-reproducers-test-code-coverage:
if [ -e stamps/run-reproducers-test-code-coverage.stamp ]; then \
rm -rf $(TEST_EXTENSIONS_DIR)/coverage ; \
rm -f $(TEST_EXTENSIONS_DIR)/coverage.xml ; \
rm -f $(TEST_EXTENSIONS_DIR)/coverage.es ; \
rm -f $(TEST_EXTENSIONS_DIR)/tests-output_withEmma.xml ; \
rm -f stamps/run-reproducers-test-code-coverage.stamp ; \
fi
clean-test-code-coverage: clean-unit-test-code-coverage clean-reproducers-test-code-coverage
if [ -e $(TESTS_DIR)/coverage.xml ]; then \
rm -rf $(TESTS_DIR)/coverage ; \
rm -f $(TESTS_DIR)/coverage.xml ; \
rm -f $(TESTS_DIR)/coverage.es ; \
rm -f $(TESTS_DIR)/coverage.em ; \
fi
clean-unit-test-code-coverage-jacoco:
if [ -e stamps/run-unit-test-code-coverage-jacoco.stamp ]; then \
rm -rf $(NETX_UNIT_TEST_DIR)/coverage ; \
rm -f $(NETX_UNIT_TEST_DIR)/coverage.xml ; \
rm -f $(NETX_UNIT_TEST_DIR)/jacoco.exec ; \
rm -f $(NETX_UNIT_TEST_DIR)/tests-output_withEmma.xml ; \
rm -f stamps/run-unit-test-code-coverage-jacoco.stamp ; \
fi
clean-reproducers-test-code-coverage-jacoco:
if [ -e stamps/run-reproducers-test-code-coverage-jacoco.stamp ]; then \
rm -rf $(TEST_EXTENSIONS_DIR)/coverage-javaws ; \
rm -f $(TEST_EXTENSIONS_DIR)/coverage-javaws.xml ; \
rm -f $(TEST_EXTENSIONS_DIR)/jacoco_javaws.exec ; \
rm -rf $(TEST_EXTENSIONS_DIR)/coverage-plugin ; \
rm -f $(TEST_EXTENSIONS_DIR)/coverage-plugin.xml ; \
rm -f $(TEST_EXTENSIONS_DIR)/jacoco_plugin.exec ; \
rm -rf $(TEST_EXTENSIONS_DIR)/coverage ; \
rm -f $(TEST_EXTENSIONS_DIR)/coverage.xml ; \
rm -f $(TEST_EXTENSIONS_DIR)/jacoco-merged-reproducers.exec ; \
rm -f $(TEST_EXTENSIONS_DIR)/tests-output_withEmma.xml ; \
rm -f stamps/run-reproducers-test-code-coverage-jacoco.stamp ; \
fi
clean-test-code-coverage-jacoco: clean-unit-test-code-coverage-jacoco clean-reproducers-test-code-coverage-jacoco clean-test-code-coverage-tools-jacoco
if [ -e $(TESTS_DIR)/coverage.xml ]; then \
rm -rf $(TESTS_DIR)/coverage ; \
rm -f $(TESTS_DIR)/jacoco-merged.exec; \
fi
clean-test-code-coverage-tools-jacoco:
rm -rf $(JACOCO_OPERATOR_DIR)
rm -rf $(COVERABLE_PLUGIN_DIR)
rm -f stamps/compile-jacoco-operator.stamp;
rm -f jacoco-operator-source-files.txt
rm -f stamps/build-fake-plugin.stamp
# plugin tests
if ENABLE_PLUGIN
stamps/plugin-tests.stamp: $(PLUGIN_TEST_SRCS) stamps/plugin.stamp
mkdir -p plugin/tests/LiveConnect
$(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \
-d plugin/tests/LiveConnect \
-classpath liveconnect/lib/classes.jar \
$(PLUGIN_TEST_SRCS) ;
$(BOOT_DIR)/bin/jar cf plugin/tests/LiveConnect/PluginTest.jar \
plugin/tests/LiveConnect/*.class ;
cp -pPR $(SRC_DIR_LINK) $(abs_top_srcdir)/plugin/tests/LiveConnect/*.{js,html} \
plugin/tests/LiveConnect ;
echo "Done. Now launch \"firefox file://`pwd`/index.html\"" ;
mkdir -p stamps
touch stamps/plugin-tests.stamp
endif
# Bootstrap Directory Targets
# ===========================
stamps/native-ecj.stamp:
mkdir -p stamps ; \
if test "x$(GCJ)" != "xno"; then \
$(GCJ) $(IT_CFLAGS) -Wl,-Bsymbolic -findirect-dispatch -o native-ecj \
--main=org.eclipse.jdt.internal.compiler.batch.Main ${ECJ_JAR} ; \
fi ; \
touch stamps/native-ecj.stamp
clean-native-ecj:
rm -f native-ecj
rm -rf stamps/native-ecj.stamp
# bootstrap
stamps/bootstrap-directory.stamp: stamps/native-ecj.stamp
mkdir -p $(BOOT_DIR)/bin stamps/
ln -sf $(JAVA) $(BOOT_DIR)/bin/java
ln -sf $(JAR) $(BOOT_DIR)/bin/jar
ln -sf $(abs_top_builddir)/javac $(BOOT_DIR)/bin/javac
ln -sf $(JAVADOC) $(BOOT_DIR)/bin/javadoc
if [ -e "$(KEYTOOL)" ] ; then \
ln -sf $(KEYTOOL) $(BOOT_DIR)/bin/keytool ;\
else \
echo "#! /bin/sh" > $(BOOT_DIR)/bin/keytool ;\
echo "echo \"keytool not exist on your system, signed part of reproducers test will fail\"" >> $(BOOT_DIR)/bin/keytool ;\
chmod 777 $(BOOT_DIR)/bin/keytool ;\
fi
if [ -e "$(JARSIGNER)" ] ; then \
ln -sf $(JARSIGNER) $(BOOT_DIR)/bin/jarsigner ;\
else \
echo "#! /bin/sh" > $(BOOT_DIR)/bin/jarsigner ;\
echo "echo \"jarsigner not exist on your system, signed part of reproducers test will fail\"" >> $(BOOT_DIR)/bin/jarsigner ;\
chmod 777 $(BOOT_DIR)/bin/jarsigner ;\
fi
mkdir -p $(BOOT_DIR)/jre/lib && \
ln -s $(SYSTEM_JRE_DIR)/lib/rt.jar $(BOOT_DIR)/jre/lib && \
if [ -e $(SYSTEM_JRE_DIR)/lib/jsse.jar ] ; then \
ln -s $(SYSTEM_JRE_DIR)/lib/jsse.jar $(BOOT_DIR)/jre/lib ; \
else \
ln -s rt.jar $(BOOT_DIR)/jre/lib/jsse.jar ; \
fi
if [ -e $(SYSTEM_JRE_DIR)/lib/resources.jar ] ; then \
ln -s $(SYSTEM_JRE_DIR)/lib/resources.jar $(BOOT_DIR)/jre/lib ; \
else \
ln -s rt.jar $(BOOT_DIR)/jre/lib/resources.jar ; \
fi
ln -sf $(SYSTEM_JRE_DIR)/lib/$(JRE_ARCH_DIR) \
$(BOOT_DIR)/jre/lib/ && \
if ! test -d $(BOOT_DIR)/jre/lib/$(INSTALL_ARCH_DIR); \
then \
ln -sf ./$(JRE_ARCH_DIR) \
$(BOOT_DIR)/jre/lib/$(INSTALL_ARCH_DIR); \
fi;
mkdir -p $(BOOT_DIR)/include && \
for i in $(SYSTEM_JDK_DIR)/include/*; do \
test -r $$i | continue; \
i=`basename $$i`; \
rm -f $(BOOT_DIR)/include/$$i; \
ln -s $(SYSTEM_JDK_DIR)/include/$$i $(BOOT_DIR)/include/$$i; \
done
mkdir -p stamps
touch stamps/bootstrap-directory.stamp
clean-bootstrap-directory:
rm -rf $(BOOT_DIR)
if [ -e ${abs_top_builddir}/bootstrap ] ; then \
rmdir ${abs_top_builddir}/bootstrap ; \
fi
rm -f stamps/bootstrap-directory.stamp
# Target Aliases
# ===============
add-netx: stamps/add-netx.stamp
add-netx-debug: stamps/add-netx-debug.stamp
netx: stamps/netx.stamp
netx-dist: stamps/netx-dist.stamp
plugin: stamps/plugin.stamp
plugin-tests: stamps/plugin-tests.stamp
check-pac-functions: stamps/check-pac-functions.stamp
run-netx-unit-tests: stamps/run-netx-unit-tests.stamp
links: stamps/global-links.stamp
user-links: stamps/user-links.stamp
run-netx-dist-tests: stamps/run-netx-dist-tests.stamp
run-unit-test-code-coverage: stamps/run-unit-test-code-coverage.stamp
run-reproducers-test-code-coverage: stamps/run-reproducers-test-code-coverage.stamp
run-unit-test-code-coverage-jacoco: stamps/run-unit-test-code-coverage-jacoco.stamp
run-reproducers-test-code-coverage-jacoco: stamps/run-reproducers-test-code-coverage-jacoco.stamp
|