The main problem is that is quite hard the specify a single space in a GNU Make file. This requires the following trick. First you have to define a variable with nothing in and after that you can define a space by delimiting it with the variable for nothing. After that you have a variable with a single space. The following part of a Make file shows how the class path conversion can be done with the previously defined space.
# Compile Java source e := space := $(e) $(e) $(CLASSES): $(BUILD)/%.class: src/%.java | $(BUILD) @$(ECHO) JAVAC: $@ @$(JAVAC) -Xlint:unchecked \ -cp .:$(subst $(space),:,$(addprefix jar/,$(LIBS))) \ -sourcepath src:$(subst $(space),:,$(addprefix jar/,$(SRCS))) \ -d $(BUILD) $(JFLAGS) $< \ || { $(RM) $@ && $(EXIT) 1 ; }
Keine Kommentare:
Kommentar veröffentlichen