-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
1561 lines (1396 loc) · 65.3 KB
/
Makefile.am
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
# Functions to compose path/classpath
EMPTY :=
SPACE := $(EMPTY) $(EMPTY)
define joinsegments
$(subst $(SPACE),:,$(strip $1))
endef
define composeclasspath
$(if $(call joinsegments,$1),-classpath $(call joinsegments,$1),)
endef
# Source directories
export TOP_BUILD_DIR = $(abs_top_builddir)
export NETX_DIR = $(abs_top_builddir)/netx.build
export DOCS_DIR=$(TOP_BUILD_DIR)/icedtea-web-docs/$(FULL_VERSION)
export NETX_SRCDIR = $(abs_top_srcdir)/netx
export NETX_RESOURCE_DIR=$(NETX_SRCDIR)/net/sourceforge/jnlp/resources
export ICONS_DEST_DIR=$(DESTDIR)$(datadir)/pixmaps
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 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 COVERAGE_JAVA_ARGS=-Xmx2G
export COVERAGE_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
# space separated fragments for composeclasspath
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)$(JACOCO_ADVANCED_EXCLUDE),inclbootstrapclasses=true"
export JACOCO_AGENT_JAVAWS_SWITCH=\"$(JACOCO_AGENT_SWITCH),destfile=$(JACOCO_JAVAWS_RESULTS)\"
export JACOCO_AGENT_PLUGIN_SWITCH=\"$(JACOCO_AGENT_SWITCH),destfile=$(JACOCO_PLUGIN_RESULTS)\"
export JACOCO_OPERATOR_EXEC=$(SYSTEM_JRE_DIR)/bin/java $(COVERAGE_JAVA_ARGS) -cp $(call joinsegments, $(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
# note this is *space* separated list, as composeclasspath is called on them in classpath usage
JUNIT_RUNTIME:=$(JUNIT_JAR) $(HAMCREST_JAR)
# support for javaws -html needs plugin.jar on classpath. rest of javaws works of course without it.
if ENABLE_PLUGIN
PLUGIN_JAR=$(datadir)/$(PACKAGE_NAME)/plugin.jar
endif
# Conditional defintions
if HAVE_TAGSOUP
NETX_EXCLUDE_SRCS=
else
NETX_EXCLUDE_SRCS=net.sourceforge.jnlp.MalformedXMLParser.java
endif
# Flags
export IT_CFLAGS=$(CFLAGS) $(ARCHFLAG)
export IT_JAVAC_SETTINGS=-g -encoding utf-8 $(JAVACFLAGS) $(MEMORY_LIMIT) $(PREFER_SOURCE)
export IT_LANGUAGE_SOURCE_VERSION=7
export IT_CLASS_TARGET_VERSION=7
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 UNIFIED_CLASSPATH_SEGMENTS=$(datadir)/$(PACKAGE_NAME)/netx.jar $(PLUGIN_JAR) $(RHINO_JAR) $(TAGSOUP_JAR)
export UNIFIED_JACOCO_CLASSPATH_SEGMENTS=$(UNIFIED_CLASSPATH_SEGMENTS) $(JACOCO_CLASSPATH)
export UNIFIED_CLASSPATH=$(call joinsegments, $(UNIFIED_CLASSPATH_SEGMENTS))
export UNIFIED_JACOCO_CLASSPATH=$(call joinsegments, $(UNIFIED_JACOCO_CLASSPATH_SEGMENTS))
export UNIFIED_BOOTCLASSPATH=-Xbootclasspath/a:$(UNIFIED_CLASSPATH)
# note javaws, itwebsettings and policyeditor (== LAUNCHER_BOOTCLASSPATH) must be always able to compile and run *without* plugin
export LAUNCHER_BOOTCLASSPATH="$(UNIFIED_BOOTCLASSPATH)"
export PLUGIN_BOOTCLASSPATH='"$(UNIFIED_BOOTCLASSPATH)"'
export PLUGIN_COVERAGE_BOOTCLASSPATH='"-Xbootclasspath/a:$(UNIFIED_JACOCO_CLASSPATH)"'
# 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 \
sun.applet
if ENABLE_PLUGIN
export ICEDTEAPLUGIN_CLEAN = clean-IcedTeaPlugin
export LIVECONNECT_DIR = netscape sun/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 you create netx-dist-tests-whitelist in top directory, and place "expr match" regexes
# (separate by one of IFS's values (most commonly space)) into it, you can control reproducers which compile or/xor run.
# if you need declare space in your regex, use \s as described in "expr match" documentation
ECHO_WHITELIST=if [ -f $(REPRODUCERS_CLASS_WHITELIST) ] ; then cat $(REPRODUCERS_CLASS_WHITELIST) ; else echo ".*" ; fi
if ENABLE_WHITELIST
COMPILE_WHITELIST_FILTER=`$(ECHO_WHITELIST)`
RUN_WHITELIST_FILTER=.*
else
COMPILE_WHITELIST_FILTER=.*
RUN_WHITELIST_FILTER=`$(ECHO_WHITELIST)`
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 policyeditor.desktop.in icedteaweb-completion \
itweb-settings.desktop.in launcher $(top_srcdir)/tests html-gen.sh NEW_LINE_IFS $(top_srcdir)/metadata.in
# 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=$(SYSTEM_JDK_DIR)/bin/javac
export EXPORTED_JAR=$(SYSTEM_JDK_DIR)/bin/jar
export EXPORTED_KEYTOOL=$(SYSTEM_JDK_DIR)/bin/keytool
export EXPORTED_JARSIGNER=$(SYSTEM_JDK_DIR)/bin/jarsigner
export EXPORTED_PACK200=$(SYSTEM_JDK_DIR)/bin/pack200
#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@')
policyeditor:= $(shell echo policyeditor | 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 \
launcher.build/$(policyeditor) policyeditor.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-generated-docs clean-metadata 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-generated-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 clean-metadata
install-exec-local:
${mkinstalldirs} $(DESTDIR)$(bindir) $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/ $(DESTDIR)$(libdir) $(ICONS_DEST_DIR)
if ENABLE_PLUGIN
${INSTALL_PROGRAM} $(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) $(DESTDIR)$(libdir)
${INSTALL_DATA} $(abs_top_builddir)/liveconnect/lib/classes.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar
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_DATA} $(abs_top_srcdir)/javaws.png $(ICONS_DEST_DIR)/
${INSTALL_PROGRAM} launcher.build/$(javaws) $(DESTDIR)$(bindir)
${INSTALL_PROGRAM} launcher.build/$(itweb_settings) $(DESTDIR)$(bindir)
${INSTALL_PROGRAM} launcher.build/$(policyeditor) $(DESTDIR)$(bindir)
# all generated manpages are installed in swarm
install-data-local:
${mkinstalldirs} -d $(DESTDIR)$(mandir)
cp -r "$(DOCS_DIR)/man/"* $(DESTDIR)$(mandir)/
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
# all generated manpages must be removed one by one
uninstall-local:
rm -f $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY)
rm -f $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar
rm -f $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar
rm -r $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/javaws_splash.png
rm -r $(ICONS_DEST_DIR)/javaws.png
KNOWN_MANS="icedtea-web.1 icedtea-web-plugin.1 itweb-settings.1 javaws.1 policyeditor.1" ; \
KNOWN_DIRS="man1 de/man1 pl/man1 cs/man1" ; \
for file in $$KNOWN_MANS ; do \
for dir in $$KNOWN_DIRS ; do \
rm -f $(DESTDIR)$(mandir)/$$dir/$$file ; \
done ; \
done
rm -f $(DESTDIR)$(bindir)/$(javaws)
rm -f $(DESTDIR)$(bindir)/$(itweb_settings)
rm -f $(DESTDIR)$(bindir)/$(policyeditor)
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\"" \
-DJAVAWS_BIN="\"$(bindir)/$(javaws)\"" \
-DJAVAWS_NAME="\"$(javaws)\"" \
-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) \
-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\"" \
-DJAVAWS_BIN="\"$(bindir)/$(javaws)\"" \
-DJAVAWS_NAME="\"$(javaws)\"" \
-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) \
$(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 && \
$(SYSTEM_JDK_DIR)/bin/javac $(IT_JAVACFLAGS) \
-d $(abs_top_builddir)/liveconnect \
$(call composeclasspath,$(NETX_DIR) $(TAGSOUP_JAR) $(RHINO_JAR)) \
-sourcepath $(LIVECONNECT_SRCS) \
@liveconnect-source-files.txt ; \
fi
mkdir -p stamps
touch $@
stamps/liveconnect-dist.stamp: stamps/liveconnect.stamp
if test "x${LIVECONNECT_DIR}" != x; then \
(cd $(abs_top_builddir)/liveconnect ; \
mkdir -p lib ; \
$(SYSTEM_JDK_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) ) ; \
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
# 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 'sed' will be missing on machine, use old IFS hack as on other places
# the 'sed' cycles is changing some custom version like 1.6.2 fedora23.4 to simple 1.6
# if changed, keep in mind that also 1.7 should bubble to 1.7
# also 1.7pre or 1.7preHASH should end up like 1.7
$(abs_top_builddir)/metadata: $(top_srcdir)/metadata.in
mkdir -p $(abs_top_builddir)/metadata-work ; \
METAFILES=`ls $(top_srcdir)/metadata.in` ; \
SEDDED_VERSION=`echo "$(FULL_VERSION)" | sed 's/[^0-9]\+/ /g'` ; \
x=0; for i in $$SEDDED_VERSION ; do \
let x++; \
if [ $$x -eq 1 ] ; then V1=$$i; fi; \
if [ $$x -eq 2 ] ; then V2=$$i; fi; \
done; \
XVERSION=$$V1.$$V2; \
for F in $$METAFILES ; do \
cat $(top_srcdir)/metadata.in/$$F | sed "s;%{name};$(PACKAGE_NAME);g" | sed "s;%{version};$$XVERSION;g" > $(abs_top_builddir)/metadata-work/$$F ; \
done ; \
mv $(abs_top_builddir)/metadata-work $(abs_top_builddir)/metadata ;
check-metadata: $(abs_top_builddir)/metadata
xmllint --noout $(abs_top_builddir)/metadata/* ; \
if [ $$? -eq 0 ] ; then \
echo "Passed: well formed" ; \
else \
echo "FAILED: well formed" ; \
fi ; \
xmllint --noout --schema http://maven.apache.org/xsd/maven-4.0.0.xsd $(abs_top_builddir)/metadata/*.pom ; \
if [ $$? -eq 0 ] ; then \
echo "Passed: valid poms" ; \
else \
echo "FAILED: valid poms" ; \
fi ; \
appstream-util validate $(abs_top_builddir)/metadata/*.appdata.xml $(abs_top_builddir)/metadata/*.metainfo.xml ; \
if [ $$? -eq 0 ] ; then \
echo "Passed: valid software descriptors" ; \
else \
echo "FAILED: valid software descriptors" ; \
fi ;
# very strange results:
# appstreamcli validate $(abs_top_builddir)/metadata/*.appdata.xml $(abs_top_builddir)/metadata/*.metainfo.xml
stamps/generate-docs.stamp: stamps/netx.stamp
mkdir -p "$(DOCS_DIR)" ; \
HTML_DOCS_TARGET_DIR="$(DOCS_DIR)/html" ; \
PLAIN_DOCS_TARGET_DIR="$(DOCS_DIR)/plain" ; \
MAN_DOCS_TARGET_DIR="$(DOCS_DIR)/man" ; \
mkdir "$$HTML_DOCS_TARGET_DIR" ; \
mkdir "$$PLAIN_DOCS_TARGET_DIR" ; \
mkdir "$$MAN_DOCS_TARGET_DIR" ; \
HTML_DOCS_INDEX="$$HTML_DOCS_TARGET_DIR/index.html" ; \
TP_COMMAND="$(SYSTEM_JRE_DIR)/bin/java -cp $(NETX_DIR) net.sourceforge.jnlp.util.docprovider.TextsProvider" ; \
TP_TAIL="false $(FULL_VERSION)" ; \
LANG_BACKUP=$$LANG ; \
echo "<html><head><title>$(PLUGIN_VERSION)</title></head>" > "$$HTML_DOCS_INDEX" ; \
echo "<body><h3>$(PLUGIN_VERSION) docs:</h3>" >> "$$HTML_DOCS_INDEX" ; \
for LANG_ID in en_US.UTF-8 cs_CZ.UTF-8 pl_PL.UTF-8 de_DE.UTF-8 ; do \
ID=`echo "$$LANG_ID" | head -c 2` ; \
ENCOD=`echo "$$LANG_ID" | tail -c 6 -` ; \
export LANG=$$LANG_ID; \
mkdir "$$HTML_DOCS_TARGET_DIR/$$ID" ; \
echo "<li><a href='$$ID/icedtea-web.html'>$$LANG_ID</a></li>" >> "$$HTML_DOCS_INDEX" ; \
$$TP_COMMAND html "$$HTML_DOCS_TARGET_DIR/$$ID" $$TP_TAIL ; \
mkdir "$$PLAIN_DOCS_TARGET_DIR/$$ID" ; \
$$TP_COMMAND plain "$$PLAIN_DOCS_TARGET_DIR/$$ID" 160 $$TP_TAIL; \
if [ $$ID = "en" ] ; then \
MAN_DESC="$$MAN_DOCS_TARGET_DIR/man1" ; \
else \
MAN_DESC="$$MAN_DOCS_TARGET_DIR/$$ID/man1" ; \
fi ; \
mkdir -p "$$MAN_DESC" ; \
$$TP_COMMAND man $$ENCOD "$$MAN_DESC" $$TP_TAIL ; \
$$TP_COMMAND htmlIntro "$(NETX_DIR)/net/sourceforge/jnlp/resources/about_$$ID.html" $$TP_TAIL; \
done ; \
export LANG=$$LANG_BACKUP ; \
echo "</body></html>" >> $$HTML_DOCS_INDEX ; \
touch $@
stamps/netx-html-gen.stamp:
(cd $$NETX_SRCDIR/..; \
mkdir -p html-gen; \
cp AUTHORS NEWS COPYING ChangeLog html-gen/; \
export HTML_GEN_DEBUG=true; \
${SHELL} html-gen.sh 33; \
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/netx-html-gen.stamp
mkdir -p $(NETX_DIR)
$(SYSTEM_JDK_DIR)/bin/javac $(IT_JAVACFLAGS) \
-d $(NETX_DIR) \
-sourcepath $(NETX_SRCDIR) \
$(call composeclasspath, $(TAGSOUP_JAR) $(RHINO_JAR)) \
@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 stamps/generate-docs.stamp $(abs_top_builddir)/metadata
(cd $(NETX_DIR) ; \
mkdir -p lib ; \
$(SYSTEM_JDK_DIR)/bin/jar cfm lib/classes.jar \
$(abs_top_builddir)/netx.manifest javax/jnlp net sun; \
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 sun)
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) < $< > $@
launcher.build/$(policyeditor): launcher/launchers.in
mkdir -p launcher.build
MAIN_CLASS=net.sourceforge.jnlp.security.policyeditor.PolicyEditor ;\
BIN_LOCATION=$(bindir)/$(policyeditor) ;\
PROGRAM_NAME=$(policyeditor) ;\
$(edit_launcher_script) < $< > $@
clean-launchers:
rm -f launcher.build/$(javaws)
rm -f launcher.build/$(itweb_settings)
rm -f launcher.build/$(policyeditor)
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
policyeditor.desktop: $(srcdir)/policyeditor.desktop.in
sed 's#PATH_TO_POLICYEDITOR#$(bindir)/$(policyeditor)#' \
< $(srcdir)/policyeditor.desktop.in > policyeditor.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:
if ENABLE_DOCS
$(SYSTEM_JDK_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>' \
$(call composeclasspath, $(TAGSOUP_JAR) $(RHINO_JAR)) \
$(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:
if ENABLE_DOCS
if ENABLE_PLUGIN
$(SYSTEM_JDK_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>' \
$(call composeclasspath, $(TAGSOUP_JAR) $(RHINO_JAR)) \
$(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
clean-generated-docs:
rm -rf "$(DOCS_DIR)"
rm -f stamps/generate-docs.stamp
clean-metadata:
rm -rf $(abs_top_builddir)/metadata
# 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:
./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) && \
$(SYSTEM_JDK_DIR)/bin/javac $(IT_JAVACFLAGS) \
-d $(JUNIT_RUNNER_DIR) \
$(call composeclasspath, $(JUNIT_RUNTIME) $(TEST_EXTENSIONS_DIR)) \
@junit-runner-source-files.txt && \
$(SYSTEM_JDK_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)/ ; \
for x in $(COMPILE_WHITELIST_FILTER) ; do \
find . -maxdepth 1 -mindepth 1 | sed "s/.\/*//" | grep $$x > $(abs_top_builddir)/$@ || true ; \
done
junit-jnlp-dist-simple.txt:
cd $(REPRODUCERS_TESTS_SRCDIR)/simple/ ; \
for x in $(COMPILE_WHITELIST_FILTER) ; do \
find . -maxdepth 1 -mindepth 1 | sed "s/.\/*//" | grep $$x > $(abs_top_builddir)/$@ || true ; \
done
stamps/junit-jnlp-dist-signed.stamp:
types=($(SIGNED_REPRODUCERS)) ; \
for which in "$${types[@]}" ; do \
pushd $(REPRODUCERS_TESTS_SRCDIR)/$$which/ ; \
for x in $(COMPILE_WHITELIST_FILTER) ; do \
find . -maxdepth 1 -mindepth 1 | sed "s/.\/*//" | grep $$x > $(abs_top_builddir)/junit-jnlp-dist-$$which.txt ; \
done ; \
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/.\/*//"` ; \
$(SYSTEM_JDK_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 \
$(SYSTEM_JDK_DIR)/bin/jar cfm "$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/$$dir.jar" $(META_MANIFEST) * ; \
else \
$(SYSTEM_JDK_DIR)/bin/jar cf "$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/$$dir.jar" * ; \
fi; \
AN="Application-Name:" ; \
grep $$AN $(META_MANIFEST) 2>/dev/null >/dev/null ; \
GREP_R=$$?; \
if [ ! -f $(META_MANIFEST) -o $$GREP_R -ne 0 ]; \
then \
TMP_MANIFEST=`mktemp` ; \
echo "$$AN $$dir" > $$TMP_MANIFEST ; \
$(SYSTEM_JDK_DIR)/bin/jar ufm "$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/$$dir.jar" $$TMP_MANIFEST ; \
rm -f $$TMP_MANIFEST ; \
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 ; \
$(SYSTEM_JRE_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 \
$(SYSTEM_JDK_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); \
keystoredir=`dirname $(PUBLIC_KEYSTORE)`; \
[ ! -d $(keystoredir) ] && mkdir -p $(keystoredir); \
for which in "$${types[@]}" ; do \
$(SYSTEM_JDK_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 \
$(SYSTEM_JDK_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); \
keystoredir=`dirname $(PUBLIC_KEYSTORE)`; \
[ ! -d $(keystoredir) ] && mkdir -p $(keystoredir); \
for which in "$${types[@]}" ; do \
yes | $(SYSTEM_JDK_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); \
keystoredir=`dirname $(PUBLIC_KEYSTORE)`; \
[ ! -d $(keystoredir) ] && mkdir -p $(keystoredir); \
for which in "$${types[@]}" ; do \
$(SYSTEM_JDK_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);
$(SYSTEM_JDK_DIR)/bin/javac $(IT_JAVACFLAGS) \
-d $(TEST_EXTENSIONS_DIR) \
$(call composeclasspath, $(JUNIT_RUNTIME) $(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:
for x in $(COMPILE_WHITELIST_FILTER) ; do \
find $(TEST_EXTENSIONS_TESTS_SRCDIR) -name '*.java' | grep $$x | sort > $@ ; \
done
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);
for x in `cat $(abs_top_builddir)/test-extensions-tests-source-files.txt` ; do \
$(SYSTEM_JDK_DIR)/bin/javac $(IT_JAVACFLAGS) \
-d $(TEST_EXTENSIONS_TESTS_DIR) \
$(call composeclasspath, $(JUNIT_RUNTIME) $(NETX_DIR)/lib/classes.jar $(TEST_EXTENSIONS_DIR)) \
$$x ; \
done ; \
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 \
echo "compiling" $$dir ; \
$(SYSTEM_JDK_DIR)/bin/javac $(IT_JAVACFLAGS) \
-d $(TEST_EXTENSIONS_TESTS_DIR) \
$(call composeclasspath, $(JUNIT_RUNTIME) $(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 \