# This Makefile defines the standard rules for building the project.
|
# This Makef^ile defines the standard rules for building the project.
|
#
|
#
|
# The following variables are used:
|
# The following variables are used:
|
#
|
#
|
# ZTEXPREFIX
|
# ZTEXPREFIX
|
# Defines the location of the EZ-USB SDK
|
# Defines the location of the EZ-USB SDK
|
# Must be defined!
|
# Must be defined!
|
# Example: ZTEXPREFIX=../../..
|
# Example: ZTEXPREFIX=../../..
|
#
|
#
|
# JARTARGET
|
# JARTARGET
|
# The name of the jar archive
|
# The name of the jar archive
|
# Example: JARTARGET=UCEcho.jar
|
# Example: JARTARGET=UCEcho.jar
|
#
|
#
|
# CLASSTARGETS
|
# CLASSTARGETS
|
# Java Classes that have to be build
|
# Java Classes that have to be build
|
# Example: CLASSTARGETS=UCEcho.class
|
# Example: CLASSTARGETS=UCEcho.class
|
#
|
#
|
# CLASSEXTRADEPS
|
# CLASSEXTRADEPS
|
# Extra dependencies for Java Classes
|
# Extra dependencies for Java Classes
|
# Example: CLASSEXTRADEPS:=$(shell echo $(ZTEXPREFIX)/java/ztex/*.java)
|
# Example: CLASSEXTRADEPS:=$(wildcard $(ZTEXPREFIX)/java/ztex/*.java)
|
#
|
#
|
# IHXTARGETS
|
# IHXTARGETS
|
# ihx files (firmware ROM files) that have to be build
|
# ihx files (firmware ROM files) that have to be build
|
# Example: IHXTARGETS=ucecho.ihx
|
# Example: IHXTARGETS=ucecho.ihx
|
#
|
#
|
# IHXEXTRADEPS
|
# IHXEXTRADEPS
|
# Extra Dependencies for ihx files
|
# Extra Dependencies for ihx files
|
# Example: IHXEXTRADEPS:=$(shell echo $(ZTEXPREFIX)/include/*.h)
|
# Example: IHXEXTRADEPS:=$(wildcard $(ZTEXPREFIX)/include/*.h)
|
#
|
#
|
# EXTRAJARFILES
|
# EXTRAJARFILES
|
# Extra files that should be included into the jar archive
|
# Extra files that should be included into the jar archive
|
# Example: EXTRAJARFILES=ucecho.ihx fpga/ucecho.bin
|
# Example: EXTRAJARFILES=ucecho.ihx fpga/ucecho.bin
|
# EXTRAJARFLAGS
|
# EXTRAJARFLAGS
|
# Extra flags for the jar command
|
# Extra flags for the jar command
|
# Example: EXTRAJARFLAGS=-C com
|
# Example: EXTRAJARFLAGS=-C com
|
|
|
# EXTRACLEANFILES
|
# EXTRACLEANFILES
|
# Extra files that should be cleaned by target "clean"
|
# Extra files that should be cleaned by target "clean"
|
|
|
# EXTRADISTCLEANFILES
|
# EXTRADISTCLEANFILES
|
# Extra files that should be cleaned by target "distclean"
|
# Extra files that should be cleaned by target "distclean"
|
|
|
|
|
.PHONY: all ihx jar clean distclean default
|
.PHONY: all ihx jar clean distclean default avr avrclean avrdistclean
|
|
.SUFFIXES: .ihx .class .jar .java .c
|
|
|
JAVAC=javac
|
JAVAC=javac
|
SDCC=$(ZTEXPREFIX)/bin/bmpsdcc.sh
|
SDCC=$(ZTEXPREFIX)/bin/bmpsdcc.sh
|
CLASSPATH:=.:$(ZTEXPREFIX)/libusbJava:$(ZTEXPREFIX)/java:$(CLASSPATH)
|
CLASSPATH:=.:$(ZTEXPREFIX)/libusbJava:$(ZTEXPREFIX)/java:$(CLASSPATH)
|
INCLUDES=-I $(ZTEXPREFIX)/include/
|
INCLUDES=-I $(ZTEXPREFIX)/include/
|
|
|
all : ihx jar
|
all : ihx jar
|
ihx : $(IHXTARGETS)
|
ihx : $(IHXTARGETS)
|
jar : $(JARTARGET)
|
jar : $(JARTARGET)
|
|
|
%.ihx: %.c $(IHXEXTRADEPS)
|
%.ihx: %.c $(IHXEXTRADEPS)
|
$(SDCC) $< "$(INCLUDES)"
|
$(SDCC) $< "$(INCLUDES)"
|
|
|
%.class: %.java $(CLASSEXTRADEPS)
|
%.class: %.java $(CLASSEXTRADEPS)
|
$(JAVAC) -cp "$(CLASSPATH)" $<
|
$(JAVAC) -cp "$(CLASSPATH)" $<
|
|
|
$(JARTARGET) : $(CLASSTARGETS) $(EXTRAJARFILES)
|
$(JARTARGET) : $(CLASSTARGETS) $(EXTRAJARFILES)
|
jar cf $(JARTARGET) *.class $(EXTRAJARFILES) $(EXTRAJARFLAGS) -C $(ZTEXPREFIX)/libusbJava . $(shell cd $(ZTEXPREFIX)/java; ls ztex/*.class | while read a; do echo "-C $(ZTEXPREFIX)/java $$a"; done)
|
jar cf $(JARTARGET) *.class $(EXTRAJARFILES) $(EXTRAJARFLAGS) -C $(ZTEXPREFIX)/libusbJava . $(shell cd $(ZTEXPREFIX)/java; ls ztex/*.class | while read a; do echo "-C $(ZTEXPREFIX)/java $$a"; done)
|
|
|
clean:
|
clean:
|
rm -f *~ *.bak *.old
|
rm -f *~ *.bak *.old
|
rm -f *.class
|
rm -f *.class
|
rm -f *.rel *.rst *.lnk *.lst *.map *.asm *.sym *.mem *.tmp.c
|
rm -f *.rel *.rst *.lnk *.lst *.map *.asm *.sym *.mem *.tmp.c
|
rm -f $(EXTRACLEANFILES)
|
rm -f $(EXTRACLEANFILES)
|
|
|
distclean: clean
|
distclean: clean
|
rm -f $(JARTARGET)
|
rm -f $(JARTARGET)
|
rm -f *.ihx
|
rm -f *.ihx
|
rm -f $(EXTRADISTCLEANFILES)
|
rm -f $(EXTRADISTCLEANFILES)
|
|
|
|
avr:
|
|
if [ -d avr ]; then make -C avr all; fi
|
|
|
|
avrclean:
|
|
if [ -d avr ]; then make -C avr clean; fi
|
|
|
|
avrdistclean:
|
|
if [ -d avr ]; then make -C avr distclean; fi
|
|
|