aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Koscher <github@degdeg.com>2013-06-24 13:28:26 -0700
committerKarl Koscher <github@degdeg.com>2013-06-24 13:28:26 -0700
commit9b82732c5b77ee32ae081a8f7b3cb881edf3f9d2 (patch)
tree0f2e975bbda9fb5debbcd47418fe407d35519431
parent836f614d75269d2cb631bf1c1bf8637efc079d61 (diff)
Fix some Makefile bugs and add some Windows support
-rw-r--r--javacard/makefiles/applet-project.mk26
1 files changed, 16 insertions, 10 deletions
diff --git a/javacard/makefiles/applet-project.mk b/javacard/makefiles/applet-project.mk
index ebc2bd5..bfb20cd 100644
--- a/javacard/makefiles/applet-project.mk
+++ b/javacard/makefiles/applet-project.mk
@@ -1,10 +1,16 @@
BUILD_DIR = ./build
BUILD_CLASSES_DIR = $(BUILD_DIR)/classes
BUILD_JAVACARD_DIR = $(BUILD_DIR)/javacard
-JAVACARD_EXPORT_DIR = $(JAVACARD_SDK_DIR)/api21_export_files
-CLASSPATH = $(JAVACARD_SDK_DIR)/lib/api21.jar:$(JAVACARD_SDK_DIR)/lib/sim.jar
-JFLAGS = -target 1.1 -source 1.3 -g -d $(BUILD_CLASSES_DIR) -classpath $(CLASSPATH)
-JC = javac
+JAVACARD_SDK_DIR ?= $(SIMTOOLS_DIR)/javacard
+JAVACARD_EXPORT_DIR ?= $(JAVACARD_SDK_DIR)/api21_export_files
+ifdef COMSPEC
+ CLASSPATH = $(JAVACARD_SDK_DIR)/lib/api21.jar;$(JAVACARD_SDK_DIR)/lib/sim.jar
+else
+ CLASSPATH = $(JAVACARD_SDK_DIR)/lib/api21.jar:$(JAVACARD_SDK_DIR)/lib/sim.jar
+endif
+JFLAGS = -target 1.1 -source 1.3 -g -d $(BUILD_CLASSES_DIR) -classpath "$(CLASSPATH)"
+JAVA ?= java
+JC ?= javac
.SUFFIXES: .java .class
.java.class:
@@ -13,11 +19,11 @@ JC = javac
$(JC) $(JFLAGS) $*.java
- $(JAVACARD_SDK_DIR)/bin/converter \
- -d $(BUILD_JAVACARD_DIR) \
- -classdir $(BUILD_CLASSES_DIR) \
- -exportpath $(JAVACARD_EXPORT_DIR) \
- -applet $(APPLET_AID) $(APPLET_NAME) \
+ $(JAVA) -jar $(JAVACARD_SDK_DIR)/bin/converter.jar \
+ -d $(BUILD_JAVACARD_DIR) \
+ -classdir $(BUILD_CLASSES_DIR) \
+ -exportpath $(JAVACARD_EXPORT_DIR) \
+ -applet $(APPLET_AID) $(APPLET_NAME) \
$(PACKAGE_NAME) $(PACKAGE_AID) $(PACKAGE_VERSION)
default: classes
@@ -31,7 +37,7 @@ install:
$(eval CAP_FILE := $(shell find $(BUILD_JAVACARD_DIR) -name *.cap))
$(eval MODULE_AID := $(shell echo $(APPLET_AID) | sed 's/0x//g' | sed 's/\://g'))
$(eval INSTANCE_AID := $(shell echo $(APPLET_AID) | sed 's/0x//g' | sed 's/\://g'))
- ../sim-tools/bin/shadysim \
+ $(SIMTOOLS_DIR)/bin/shadysim \
$(SHADYSIM_OPTIONS) \
-l $(CAP_FILE) \
-i $(CAP_FILE) \