Modified java rules.
This commit is contained in:
+19
-19
@@ -431,51 +431,51 @@ endif #ifdef PROD
|
||||
# Java classes and packages
|
||||
#
|
||||
|
||||
# install and clean rules are strange because java may create multiple
|
||||
# class files from one java file. For example from xx.java file the
|
||||
# files xx.class xx$1.class, xx$2.class ... may be created
|
||||
# and gnumake cannot easily handle files with $ in name
|
||||
|
||||
INSTALL_JAVA = $(INSTALL_LOCATION)/javalib
|
||||
DIRECTORY_TARGETS += $(INSTALL_JAVA) $(INSTALL_JAVA)/$(PACKAGE)
|
||||
|
||||
CLASSES += $(subst .java,.class,$(foreach package,$(PACKAGES),$(wildcard $(package)/*.java)))
|
||||
TESTCLASSES += $(subst .java,.class,$(foreach package,$(TESTPACKAGES),$(wildcard $(package)/*.java)))
|
||||
INSTALL_CLASSES =$(CLASSES:%=$(INSTALL_JAVA)/%)
|
||||
vpath %.class $(INSTALL_JAVA)/$(PACKAGE)
|
||||
|
||||
CLASSES += $(subst .java,.class,$(JAVA))
|
||||
TESTCLASSES += $(subst .java,.class,$(TESTJAVA))
|
||||
INSTALL_CLASSES =$(CLASSES:%=$(INSTALL_JAVA)/$(PACKAGE)/%)
|
||||
INSTALL_JAR =$(JAR:%=$(INSTALL_JAVA)/%)
|
||||
|
||||
CLEAN_CLASSES = *.class $(foreach package,$(PACKAGES) $(TESTPACKAGES),$(package)/*.class)
|
||||
|
||||
JAR_OPTIONS = cvf
|
||||
ifdef MANIFEST
|
||||
JAR_OPTIONS = cvmf
|
||||
endif
|
||||
JAR_DEPFILES += $(wildcard $(JAR_INPUT) $(addsuffix /*,$(JAR_INPUT)))
|
||||
|
||||
build:: $(CLASSES) $(TESTCLASSES) $(JAR)
|
||||
$(DIRECTORY_TARGETS) :
|
||||
$(MKDIR) $@
|
||||
|
||||
buildInstall :: $(INSTALL_CLASSES) $(INSTALL_JAR)
|
||||
build:: $(TESTCLASSES) $(JAR)
|
||||
|
||||
buildInstall :: $(DIRECTORY_TARGETS) $(INSTALL_CLASSES) $(INSTALL_JAR)
|
||||
|
||||
clean::
|
||||
@$(RM) $(CLEAN_CLASSES) $(TESTCLASSES) $(JAR)
|
||||
@$(RM) $(TESTCLASSES) $(JAR)
|
||||
|
||||
%.class:%.java
|
||||
@echo Creating java class file $@
|
||||
$(RM) $@
|
||||
$(JAVACCMD)
|
||||
$(JAVACCMD) $<
|
||||
|
||||
$(INSTALL_JAVA)/$(PACKAGE)/%.class:%.java
|
||||
@echo Creating java class file $@
|
||||
@$(RM) $@
|
||||
$(JAVACCMD) -d $(INSTALL_JAVA) $<
|
||||
|
||||
$(JAR):%.jar: $(JAR_DEPFILES)
|
||||
@echo Creating java jar file $@
|
||||
$(RM) $@
|
||||
@$(RM) $@
|
||||
$(JARCMD)
|
||||
|
||||
$(INSTALL_JAVA)/%.jar: %.jar
|
||||
@echo "Installing jar file $@"
|
||||
$(INSTALL) -d -m 644 $< $(@D)
|
||||
|
||||
$(INSTALL_JAVA)/%.class: %.class
|
||||
@echo "Installing java file $@"
|
||||
$(INSTALL) -d -m 644 $(*)*.class $(@D)
|
||||
|
||||
#---------------------------------------------------------------
|
||||
#---------------------------------------------------------------
|
||||
# Generic Rules for 'simple' targets that
|
||||
|
||||
Reference in New Issue
Block a user