-
Notifications
You must be signed in to change notification settings - Fork 28
/
common.mk
96 lines (88 loc) · 2.78 KB
/
common.mk
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
# Copyright (C) 2015-2021 JovalCM.com. All rights reserved.
# This software is licensed under the LGPL 3.0 license available at http://www.gnu.org/licenses/lgpl.txt
SCAP_VERSION=1.3.0.0.0-9
OVAL_VERSION=5.11.2
Default: all
ifeq (x, x$(JAVA_HOME))
$(error "Please set the JAVA_HOME environment variable.")
endif
PLATFORM=unknown
ifeq (Windows, $(findstring Windows,$(OS)))
PLATFORM=win
CLN=;
else
OS=$(shell uname)
ifeq (Linux, $(findstring Linux,$(OS)))
PLATFORM=linux
else ifeq (Darwin, $(findstring Darwin,$(OS)))
PLATFORM=mac
endif
CLN=:
endif
ifeq (win, $(PLATFORM))
WIN_JAVA_HOME=$(shell cygpath -u $(JAVA_HOME))
JAVA=$(WIN_JAVA_HOME)/bin/java.exe
JAR=$(WIN_JAVA_HOME)/bin/jar.exe
JAVADOC=$(WIN_JAVA_HOME)/bin/javadoc.exe
JAVAC=$(WIN_JAVA_HOME)/bin/javac.exe
CLASSLIB=$(shell cygpath -w $(JAVA_HOME))\jre\lib\rt.jar
NUMPROCS=1
else
JAVA=$(JAVA_HOME)/bin/java
JAR=$(JAVA_HOME)/bin/jar
JAVADOC=$(JAVA_HOME)/bin/javadoc
JAVAC=$(JAVA_HOME)/bin/javac
CLASSLIB=$(JAVA_HOME)/jre/lib/rt.jar
ifeq (mac, $(PLATFORM))
NUMPROCS=$(shell sysctl -n hw.ncpu)
else
NUMPROCS=$(shell nproc)
endif
endif
RAW_JAVA_VERSION:=$(shell $(JAVA_HOME)/bin/java -version 2>&1)
ifeq (1.8, $(findstring 1.8, $(RAW_JAVA_VERSION)))
JAVA_VERSION=1.8
JAVADOCFLAGS=-Xdoclint:none -J-Xmx512m
else ifeq (1.7, $(findstring 1.7, $(RAW_JAVA_VERSION)))
JAVA_VERSION=1.7
JAVADOCFLAGS=-J-Xmx512m
else ifeq (1.6, $(findstring 1.6, $(RAW_JAVA_VERSION)))
JAVA_VERSION=1.6
JAVADOCFLAGS=-J-Xmx512m
else
$(error "Unsupported Java version: $(RAW_JAVA_VERSION)")
endif
NULL:=
SPACE:=$(NULL) # end of the line
SHELL=/bin/sh
CWD=$(shell pwd)
BUILD=build
RSRC=rsrc
DOCS=docs
GEN=gen-src
SCHEMADIR=schemas
OVAL_SRC=$(THIRDPARTY)/OVAL/oval-schemas
OVAL_SCHEMA=$(SCHEMADIR)/oval
BINDINGS=$(SCHEMADIR)/bindings.xjb
CATALOG=schemas.cat
EPISODE=schemas.episode
XJCFLAGS=-enableIntrospection -catalog $(CATALOG) -episode $(EPISODE)
XJCFLAGS_EXT=-classpath "$(NAMESPACE_PLUGIN)" $(XJCFLAGS) -extension -Xnamespace-prefix
XJC=$(JAVA) -Djavax.xml.accessExternalSchema=all -Dcom.sun.tools.xjc.XJCFacade.nohack=true -cp $(XJC_LIB) com.sun.tools.xjc.XJCFacade
#
# Make namespaces optional in the episode bindings
#
BROKEN=<bindings scd=\"x-schema::tns\"
FIXED=<bindings scd=\"x-schema::tns\" if-exists=\"true\"
SCAP=$(TOP)/scap
SCAP_LIB=$(SCAP)/scap-schema-$(SCAP_VERSION).jar
SCAP_EXT=$(TOP)/scap-extensions
SCAP_EXT_LIB=$(SCAP_EXT)/scap-schema-extensions.jar
CYBERSCOPE=$(TOP)/cyberscope
CYBERSCOPE_LIB=$(CYBERSCOPE)/cyberscope-schema.jar
DODARF=$(TOP)/dod-arf
DODARF_LIB=$(DODARF)/DoD-ARF-schema.jar
THIRDPARTY=$(TOP)/3rd-party
SAXON_LIB=$(THIRDPARTY)/saxon9he.jar
XJC_LIB=$(THIRDPARTY)/jaxb-xjc-2.2.6.jar
NAMESPACE_PLUGIN=$(THIRDPARTY)/jaxb2-namespace-prefix-1.3.jar