Initial2.
authorviric@llimona
Mon, 23 Jul 2007 21:06:25 +0200
changeset 1 fc732b24c9ba
parent 0 d6867274bc45
child 2 88b94872d8f9
Initial2.
Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile	Mon Jul 23 21:06:25 2007 +0200
@@ -0,0 +1,59 @@
+# PRJ
+PRJ=jdict
+VENDOR=viric
+VERSION=0.1
+
+# RTE
+WTK2?=/opt/wtk2.2
+EMULATOR=${WTK2}/bin/emulator
+CLASSPATH=${WTK2}/lib/midpapi10.jar:${WTK2}/lib/cldcapi10.jar:${PRJ}.jar:.
+#CLASSPATH=${WTK2}/lib/midpapi.zip:mojab.jar:./src/:.
+SRCDIRS=${PRJ}
+PKGADDONS=icones dicts
+
+# TARJETS
+all:
+	@cd src && mkdir -p output ${SRCDIRS} ${PKGADDONS}
+	@echo "==> Building"
+	@cd src && \
+		javac -g -source 1.2 -target 1.1 -classpath ${CLASSPATH} \
+		-bootclasspath ${CLASSPATH} -encoding UTF-8 \
+		`find ${SRCDIRS} -type f -iname *.java`
+	@echo "==> Preverifying"
+	@cd src && \
+	${WTK2}/bin/preverify1.1 -classpath ./:${CLASSPATH} \
+		`find ${SRCDIRS} |grep class|awk -F . '{ print $$1; }'`
+
+clean:
+	@echo "==> Cleaning"
+	@rm -rf ${PRJ}.jad ${PRJ}.jar `find src/| grep class` src/output javadoc
+
+doc:
+	@echo "==> Generating documentation" 
+	@cd src && \
+	javadoc -classpath ${CLASSPATH} -d ../javadoc/ \
+	`find ${SRCDIRS} -type f -iname *.java`
+
+imatges:
+	./makepngs
+	rm src/imatges/*
+	cp png/* src/imatges
+
+jar:
+	@echo "==> Generating JAR file"
+	@cd src && cp -rf ${PKGADDONS} output/
+	@cd src/output && \
+	jar cmf ../META-INF/MANIFEST.MF ../${PRJ}.jar `find .| grep class` ${PKGADDONS}
+	@mv src/${PRJ}.jar ./
+	@echo "==> Generating manifest for JAD file"
+	@echo "MIDlet-1: ${PRJ}, /icons/online.png, ${PRJ}.Main" > ${PRJ}.jad
+	@echo "MIDlet-Jar-Size: `ls -l ${PRJ}.jar|awk '{print $$5 }'`" >> ${PRJ}.jad
+	@echo "MIDlet-Jar-URL: ${PRJ}.jar" >> ${PRJ}.jad
+	@echo "MIDlet-Name: ${PRJ}" >> ${PRJ}.jad
+	@echo "MIDlet-Vendor: ${VENDOR}" >> ${PRJ}.jad
+	@echo "MIDlet-Version: ${VERSION}" >> ${PRJ}.jad
+
+run:
+	@echo "==> Running emulator"
+	@${EMULATOR} -classpath ${CLASSPATH} -Xdescriptor:${PRJ}.jad \
+	-Xdevice:DefaultColorPhone