1 | ## @file
|
---|
2 | # Makefile for a sample/testcase using the 'glue' Java API bindings
|
---|
3 |
|
---|
4 | #
|
---|
5 | # Copyright (C) 2010-2023 Oracle and/or its affiliates.
|
---|
6 | #
|
---|
7 | # This file is part of VirtualBox base platform packages, as
|
---|
8 | # available from https://www.virtualbox.org.
|
---|
9 | #
|
---|
10 | # This program is free software; you can redistribute it and/or
|
---|
11 | # modify it under the terms of the GNU General Public License
|
---|
12 | # as published by the Free Software Foundation, in version 3 of the
|
---|
13 | # License.
|
---|
14 | #
|
---|
15 | # This program is distributed in the hope that it will be useful, but
|
---|
16 | # WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
18 | # General Public License for more details.
|
---|
19 | #
|
---|
20 | # You should have received a copy of the GNU General Public License
|
---|
21 | # along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
22 | #
|
---|
23 | # SPDX-License-Identifier: GPL-3.0-only
|
---|
24 | #
|
---|
25 |
|
---|
26 | #
|
---|
27 | # User serviceable parts: adjust the following lines appropriately
|
---|
28 | #
|
---|
29 |
|
---|
30 | # The host OS: linux, solaris, win, darwin, freebsd
|
---|
31 | HOSTOS=linux
|
---|
32 | # Absolute (!) path to the VirtualBox install directory
|
---|
33 | VBOX_BIN = /opt/VirtualBox
|
---|
34 | # Path to the sdk directory of the unpacked VirtualBox SDK
|
---|
35 | VBOX_SDK = ../../..
|
---|
36 | # On Windows, if you want to use the COM API: install directory of Jacob lib
|
---|
37 | JACOB_DIR =
|
---|
38 | # Extra classpath entries needed for compiling/running the sample
|
---|
39 | CLASSPATH =
|
---|
40 | # Java compiler to use
|
---|
41 | JAVAC = javac
|
---|
42 | # Java VM to use
|
---|
43 | JAVA = java
|
---|
44 |
|
---|
45 |
|
---|
46 | #
|
---|
47 | # No changes should be necessary after this point.
|
---|
48 | #
|
---|
49 |
|
---|
50 | ifeq ($(HOSTOS),win)
|
---|
51 | JACOB_JAR=$(JACOB_DIR)/jacob.jar
|
---|
52 | VBOX_JAR=$(VBOX_SDK)/bindings/mscom/java/vboxjmscom.jar
|
---|
53 | SEP=\;
|
---|
54 | JAVA_COM_ARGS += -Djava.library.path=$(JACOB_DIR)
|
---|
55 | CLASSPATH += $(JACOB_JAR)$(SEP)
|
---|
56 | else
|
---|
57 | VBOX_JAR=$(VBOX_SDK)/bindings/xpcom/java/vboxjxpcom.jar
|
---|
58 | SEP=:
|
---|
59 | JAVA_COM_ARGS += -Dvbox.home=$(VBOX_BIN)
|
---|
60 | endif
|
---|
61 |
|
---|
62 | VBOX_JAR_WS=$(VBOX_SDK)/bindings/webservice/java/jax-ws/vboxjws.jar
|
---|
63 |
|
---|
64 |
|
---|
65 | all: ws/TestVBox.class com/TestVBox.class
|
---|
66 |
|
---|
67 | test: ws/test-TestVBox com/test-TestVBox
|
---|
68 |
|
---|
69 | com/TestVBox.class:
|
---|
70 | @mkdir com 2>/dev/null || true
|
---|
71 | $(JAVAC) -d com -cp $(VBOX_JAR)$(SEP)$(CLASSPATH) TestVBox.java
|
---|
72 |
|
---|
73 | com/test-TestVBox: com/TestVBox.class
|
---|
74 | $(JAVA) $(JAVA_COM_ARGS) -cp com$(SEP)$(VBOX_JAR)$(SEP)$(CLASSPATH) TestVBox
|
---|
75 |
|
---|
76 | ws/TestVBox.class:
|
---|
77 | @mkdir ws 2>/dev/null || true
|
---|
78 | $(JAVAC) -d ws -cp $(VBOX_JAR_WS)$(SEP)$(CLASSPATH) TestVBox.java
|
---|
79 |
|
---|
80 | ws/test-TestVBox: ws/TestVBox.class
|
---|
81 | $(JAVA) $(JAVA_WS_ARGS) -cp ws$(SEP)$(VBOX_JAR_WS)$(SEP)$(CLASSPATH) TestVBox -w -url http://localhost:18083/
|
---|