GNUmakefile 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290
  1. # $Id: GNUmakefile,v 1.20 2009-01-12 09:46:33 rzr Exp $
  2. # * @author www.Philippe.COVAL.free.fr
  3. # * Copyright and License : http://rzr.online.fr/license.htm
  4. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  5. package?=Diet3D
  6. default: all
  7. PROJECT?=Diet3D
  8. PROJECT_DIST=diet3d
  9. PROJECT_URL?="http://rzr.online.fr/java.htm"
  10. PROJECT?=${PROJECT}
  11. vendor=online.rzr
  12. package_path=fr.${vendor}
  13. activity=${PROJECT}Activity
  14. SUFFIX_MIDLET?=MIDlet
  15. #SUFFIX_MIDLET=
  16. ###############################################################################
  17. ENV?=j2me
  18. RT_LIST?=midp1_0 midp1_0-nokia midp2_0 imode exen
  19. # RT?=midp1_0
  20. # RT?=midp1_0
  21. # RT?=midp1_0-nokia
  22. RT?=midp2_0
  23. # RT?=j2se
  24. # RT=android
  25. JAVA_HOME?=/usr/lib/j2se/1.4/
  26. SW_ARC?=${HOME}/mnt/software/
  27. # commands
  28. UNZIP?=unzip -q
  29. CONVERTER?=java -cp ${SW_DIR}midp4palm1.0/Converter/Converter.jar \
  30. com.sun.midp.palm.database.MakeMIDPApp
  31. FS=\\/
  32. #export
  33. INFUSIO_PP_LIN?=\/home\/${USER}\/
  34. INFUSIO_PP_WIN?=y:
  35. export INFUSIO_PP_WIN INFUSIO_PP_LIN
  36. #
  37. SW_DIR?=/opt/
  38. SDKV_LIST?=22 21 20 00 exen
  39. #SDKV?=20
  40. SDKV?=2.2
  41. # SDKV?=2.1.01
  42. CONFIG=${RT}
  43. SDK_PATH?=${SW_DIRW}WTK104 ${SW_DIR}WTK2.1 ${SW_DIR}midp2.0fcs
  44. DATE?=$(shell date +%Y%m%d)
  45. # regnerated everytime
  46. #TMP?=$(shell mktemp)
  47. TMP=/tmp/tmp-${USER}.tmp/${package}/${RT}-${SDKV}/
  48. ID?=$(shell date +%Y%m%d%s)
  49. VERSION_MAJ=1
  50. VERSION_MIN=0
  51. VERSION_REV=0
  52. VERSION_DOT?=${VERSION_MAJ}.${VERSION_MIN}.${VERSION_REV}
  53. VERSION_CHAR?=${VERSION_MAJ}_${VERSION_MIN}_${VERSION_REV}
  54. VERSION?=${VERSION_DOT}
  55. #VERSION?=0.0.$(shell date +%Y%m%d%H)
  56. # DEFINES+=-DDEVEL -DPRIVATE
  57. DEFINES+= -DPRIVATE
  58. MKDIR?=@mkdir -p
  59. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  60. # PROJECTlication Specific
  61. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  62. DEFINES+=-DNOINLINE -DVERSION="${VERSION}"
  63. PWD:=$(shell pwd)/
  64. DESTDIR=jclasses-${CONFIG}/
  65. SRC_DIR:=src-${RT}/
  66. SRC_IN_DIR:=${CURDIR}/sources/
  67. #DESTDIR=${SRC_DIR}jclasses-${CONFIG}/
  68. WEBDIR?=${HOME}/mnt/public_html/docs/java/${PROJECT_DIST}/
  69. #URL_BASE?=file://
  70. #URL_BASE?=http://rzr.online.fr/docs/java/jclasses/
  71. #URL_BASE?=http://localhost/~${USER}/${PROJECT}/
  72. URL_BASE?=http://nrv.homelinux.org/~${USER}/${PROJECT}/
  73. #URL_BASE?=http://localhost/~rzr/${PROJECT}/
  74. URL?=${URL_BASE}${DESTDIR}${PROJECT}.jad
  75. #URL=http://rzr.online.fr/docs/java/jclasses/
  76. URL_WML?=http://localhost/~${USER}/wap.wml
  77. #URL_PUB=http://nrv.homelinux.org/~${USER}/${PROJECT}/${DESTDIR}
  78. URL_PUB?=
  79. ifeq ($(RT),midp1_0)
  80. DEFINES+=-DMIDP_1_0
  81. MIDPV="MIDP-1.0"
  82. ALL+=${DESTDIR}${PROJECT}.jad ${DESTDIR}${PROJECT}.wml ${DESTDIR}${PROJECT}.html
  83. JAVAC?=javac -target 1.2
  84. # microemu is 1.1 =45.3 # 1.1=45.3 1.2=46 1.3=47
  85. # micro emu @ moz+linux : 1.2+
  86. # micro emi @ ie+win : -target 1.1
  87. endif
  88. ifeq ($(RT),midp2_0)
  89. DEFINES+=-DMIDP_2_0
  90. MIDPV="MIDP-2.0"
  91. ALL+=${DESTDIR}${PROJECT}.jad ${DESTDIR}${PROJECT}.wml ${DESTDIR}${PROJECT}.jar
  92. endif
  93. ifeq ($(RT),midp2_1)
  94. DEFINES+=-DMIDP_2_1
  95. MIDPV="MIDP-2.1"
  96. ALL+=${DESTDIR}${PROJECT}.jad ${DESTDIR}${PROJECT}.wml ${DESTDIR}${PROJECT}.jar
  97. endif
  98. ifeq ($(RT),midp1_0-nokia)
  99. DEFINES+= -DNOKIA
  100. MIDPV="MIDP-1.0"
  101. EXT=${SW_DIR}Nokia/Devices/Nokia_Series_40_MIDP_Concept_SDK_Beta_0_3/lib/classes.zip
  102. ALL+=${DESTDIR}${PROJECT}.jad ${DESTDIR}${PROJECT}.wml
  103. endif
  104. ifeq ($(RT),imode)
  105. DEFINES+=-DNTTDOCOMO
  106. MIDPV="MIDP-1.0"
  107. API=${HOME}${SW_DIR}iDK/lib/classes.zip
  108. EXT=${HOME}${SW_DIR}iDK/lib/doja_classes.zip
  109. FILES=${PROJECT} ${PROJECT}Canvas ${PROJECT}Imode
  110. ALL+=${DESTDIR}${PROJECT}.jam
  111. endif
  112. ifeq ($(RT),midp1_0-siemens)
  113. DEFINES+=-DMIDP_1_0 -DSIEMENS
  114. MIDPV="MIDP-1.0"
  115. EXT=${HOME}/lib/java/seimens-api.jar
  116. ALL+=${DESTDIR}${PROJECT}.jad
  117. endif
  118. ifeq ($(RT),j2se)
  119. SDKV=00
  120. DEFINES+=-DAWT -DJ2SE
  121. API=""
  122. OBJ_DIR=./jclasses-${RT}/
  123. DESTDIR=${OBJ_DIR}
  124. CLASSPATH=${DESTDIR}:.
  125. FILES=${PROJECT} ${PROJECT}Canvas ${PROJECT}Applet
  126. OBJS=$(FILES:=.class) ${PROJECT}CommandLine.class
  127. ALL=${OBJS}
  128. # JAVAC= javac -target "1.1" -g:none
  129. JAVAC = javac
  130. DATA?=applet.htm
  131. DATA_DIR=${DESTDIR}
  132. PREVERIFY?=echo
  133. endif
  134. ifeq ($(RT),dalvik)
  135. RT=android
  136. endif
  137. ifeq ($(RT),android)
  138. DEFINES+=-DANDROID -DJ2SE -DNO_INLINE
  139. SDKV=00
  140. API=""
  141. OBJ_DIR=./jclasses-${RT}/
  142. DESTDIR=${OBJ_DIR}
  143. CLASSPATH=${DESTDIR}:.
  144. FILES=${PROJECT} ${PROJECT}Canvas ${PROJECT}Activity
  145. #${PROJECT}Applet
  146. OBJS=$(FILES:=.class) ${PROJECT}CommandLine.class
  147. # ALL=${OBJS}
  148. ALL=${RT}-all
  149. # JAVAC= javac -target "1.1" -g:none
  150. JAVAC = javac
  151. #DATA?=applet.htm
  152. DATA_DIR=${DESTDIR}
  153. PREVERIFY?=echo
  154. endif
  155. EXEN_TARGET?=le_default.exn
  156. ifeq ($(RT),exen)
  157. EXENC=cd ${SDK_DIR}bin && ${SDK_DIR}bin/exenc
  158. DEFINES+=-DEXEN
  159. MIDPV=exen
  160. SDKV=exen
  161. SDK=InFusioSDK
  162. SDK_DIR=${HOME}/mnt/${SDK}/
  163. API=${SDK_DIR}etc/lib/ExEnV2.jar
  164. #OBJ_DIR=./jclasses-${RT}/
  165. OBJ_DIR=${SRC_DIR}
  166. #SRC_DIR_ABS=./src-${RT}/
  167. FILES=${PROJECT} ${PROJECT}Canvas
  168. #SRCS?=${FILES:=.java}
  169. DATA=${PROJECT}.xml
  170. DATA_DIR=${SRC_DIR_ABS}
  171. ALL=${DIR_PATH} ${OBJS} all-exen
  172. DESTDIR=jclasses-${RT}/
  173. SRC_DIR=src-${RT}/
  174. OBJ_DIR=${SRC_DIR}
  175. #/jclasses-${RT}/
  176. #SRCS_IN?=${FILES:=.java.in}
  177. #OBJS?=${FILES:=.class}
  178. #PREVERIFY=${SW_DIR}midp2.0fcs/bin/preverify
  179. JAR?=echo jar
  180. JAVAC?=javac -g:none -target 1.1
  181. JAVACP?=javacp
  182. PREVERIFY?=echo preverify
  183. #SRC_DIR_ABS?=
  184. #EXEN_RUN?=cd ${SDK_DIR} && nice wine --
  185. EXEN_RUN=nice wine --
  186. WMTRANS=${EXEN_RUN} ${SDK_DIR}bin/vmtools/VMTrans.exe
  187. WMTRANS_FLAGS= -gr -v -gp -g4 -dt -vt
  188. #WMTRANS?=cd ${SDK_DIR}bin/vmtools/ && vmtrans
  189. #WMTRANS?=cd ${SDK_DIR}bin/vmtools/ && vmtrans
  190. # -dc "/home/rzr/src/${PROJECT}/src-exen/classes" -do "/home/rzr/src/${PROJECT}/src-exen/pvc" -gr -v -gp -g4 -dt -vt "resource"
  191. SDK_DIR_WIN= Y:\\home\\${USER}\\mnt\\${SDK}\\
  192. #EXEN_ROM?=${SDK_DIR_WIN}etc\\exenrom\\ExEnV2\\lexen.rom
  193. EXEN_ROM=${SDK_DIR}etc/exenrom/ExEnV2/lexen.rom
  194. #PVC2ROM?=wine -- ${SDK_DIR}bin/vmtools/exenrom/exenrom.exe
  195. #PVC2ROM?=wine -- ${SDK_DIR}bin/vmtools/exenrom/exenrom.exe
  196. PVC2ROM=wine -- ${SDK_DIR}bin/vmtools/exenrom/exenrom
  197. VM_EXEN=${EXEN_RUN} ${SDK_DIR}bin/simulator_v2/generic/Color/gensimu.exe
  198. EXN2CTC=wine -- ${HOME}/mnt/bin-WIN32/EXN2CTC.exe
  199. CLASSPATH=${OBJ_DIR}:${API}
  200. endif #endif // exen
  201. #FILES= MathFixed ${PROJECT}Render ${PROJECT}Canvas ${PROJECT}${SUFFIX_MIDLET}
  202. FILES?=${PROJECT} ${PROJECT}Canvas ${PROJECT}${SUFFIX_MIDLET}
  203. #FILES= ${PROJECT}Canvas ${PROJECT}${SUFFIX_MIDLET}
  204. ##
  205. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  206. # Env Specific
  207. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  208. ifeq ($(SDKV) , 2.2)
  209. SDK:=wtk
  210. SDK_DIR:=${SW_DIR}${SDK}/
  211. API?=${SDK_DIR}lib/cldcapi10.jar
  212. API_MIDP?=${SDK_DIR}lib/midpapi21.jar
  213. CLASSPATH=${API}:${API_MIDP}:${OBJ_DIR}:${EXT}
  214. VM=${SDK_DIR}bin/emulator
  215. # JAVACFLAGS?=-d ${OBJ_DIR} -classpath ${CLASSPATH}
  216. endif
  217. ifeq ($(SDKV),21)
  218. SDK:=WTK2.1
  219. SDK_DIR:=${SW_DIR}${SDK}/
  220. API?=${SDK_DIR}lib/cldcapi10.zip
  221. API_MIDP?=${SDK_DIR}lib/midpapi20.zip
  222. CLASSPATH=${API}:${API_MIDP}:${OBJ_DIR}:${EXT}
  223. VM=${SDK_DIR}bin/emulator
  224. endif
  225. ifeq ($(SDKV),20)
  226. SDK:=midp2.0fcs
  227. SDK_DIR:=${SW_DIR}${SDK}/
  228. MIDP_HOME=${SDK_DIR}
  229. export MIDP_HOME
  230. API?=${SDK_DIR}classes/
  231. VM=${SDK_DIR}bin/midp
  232. CLASSPATH=${API}:${EXT}:${OBJ_DIR}
  233. endif
  234. ifeq ($(SDKV),10)
  235. SDK:=WTK104
  236. SDK_DIR=${SW_DIR}${SDK}/
  237. API?=${SDK_DIR}lib/midpapi.zip
  238. CLASSPATH=${API}:${EXT}:${OBJ_DIR}
  239. VM=${SDK_DIR}bin/emulator
  240. endif
  241. ifeq ($(SDKV),2.1.01)
  242. SDK:=j2me_wireless_toolkit-2_1_01
  243. SDK_DIR:=${SW_DIR}${SDK}/
  244. API?=${SDK_DIR}lib/cldcapi10.jar
  245. API_MIDP?=${SDK_DIR}lib/midpapi20.jar
  246. CLASSPATH=${API}:${API_MIDP}:${OBJ_DIR}:${EXT}
  247. VM=${SDK_DIR}bin/emulator
  248. endif
  249. ifeq (${API},"")
  250. JAVACFLAGS?=-d ${OBJ_DIR} -classpath ${CLASSPATH}
  251. else
  252. JAVACFLAGS?=-bootclasspath ${API} -classpath ${CLASSPATH} -d ${OBJ_DIR}
  253. endif
  254. #
  255. # Default values
  256. #
  257. DESTDIR_ABS?=${CURDIR}/${DESTDIR}
  258. SRC_DIR_ABS?=${CURDIR}/${SRC_DIR}
  259. TMP_DIR=/tmp/tmp-${USER}.tmp/${package}/${RT}-${SDKV}/${CURDIR}//
  260. OBJ_DIR?=${TMP_DIR}${DESTDIR}
  261. #SRCS=$(wildcard *.java)
  262. #SRCS=
  263. #FILES=$(SRCS:.java=)
  264. # javac: target release 1.1 conflicts with default source release 1.5
  265. JAVAC?=javac -target 1.2 -source 1.2
  266. JAVA?=java
  267. APPLETVIEWER?=appletviewer
  268. JAR?=jar
  269. API?=
  270. # PREVERIFY?=preverify
  271. PREVERIFY?=${SDK_DIR}/bin/preverify
  272. #DESTDIR?=./
  273. #DESTDIR = ../jclasses-${ENV}/
  274. DIRPATH=${SRC_DIR_ABS} ${OBJ_DIR} ${DISTDIR_ABS} ${DESTDIR} ${SRC_IN_DIR}
  275. vpath:=${DIRPATH}
  276. VPATH:=${DIRPATH}
  277. PATH:=${JAVA_HOME}/bin/:${PATH}:${SDK_DIR}bin/
  278. SRCS?=$(FILES:=.java)
  279. SRCS_IN?=$(FILES:=.java.in)
  280. OBJS?=$(FILES:=.class)
  281. CLASSPATH?=${OBJ_DIR}
  282. #export RT SDKV MIDPV SDK SDK_DIR
  283. #DEFINES+="-DHAVE_AWT"
  284. export CLASSPATH
  285. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  286. # Rules
  287. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  288. all compile build: pre ${ALL} post
  289. @echo "# $@ : $^"
  290. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  291. # Application rules
  292. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  293. help: help-${PROJECT} help-${ENV} help-default
  294. help-default:
  295. grep -E '.*:' GNUmakefile
  296. @echo "#"
  297. help-${PROJECT}:
  298. @echo "#"
  299. @echo "# ${PROJECT} java / ${ENV} demo (3d engine on fixed points)"
  300. @echo "# Contact: http://rzr.online.fr/java.htm"
  301. @echo "#"
  302. help-${ENV}:
  303. @echo "# Type following targets for compiling or running :"
  304. @echo "#"
  305. @echo "# make run # 3d demo (start ${ENV} emulator)"
  306. @echo "# make applet # 3d demo (start j2sk appletviewer)"
  307. @echo "# make all # compile sources (all)"
  308. @echo "# make compile # compile sources (step)"
  309. @echo "# make clean # wipe .class out"
  310. @echo "#"
  311. @echo "# Options are : make RT=[${RT}] SDKV=[${SDKV}]"
  312. @echo "# RT { ${RT_LIST} }"
  313. @echo "# SDK { ${SDKV_LIST} }"
  314. @echo ""
  315. @echo "# VPATH=${VPATH}"
  316. # @echo "make application # 3d demo (lunch it in jvm)"
  317. #mesh:
  318. # ../diet3d-tools/diet3dconvert --stdio --langjava < ../../diet3d-rzr/ext-data/simpson-front.asc >| ../diet3d-java/Mesh.java
  319. # sed -e "s/\/\/\(.\*@use_awt\)/\1/g" < ${PROJECT}Render.java
  320. dist: clean-bak diet3d-java.zip
  321. cp ../diet3d-java.zip ${WEBDIR}
  322. # -cp ${OBJ_DIR}*.java ${SRC_DIR_ABS}
  323. ${PROJECT}Canvas.java.in: ${PROJECT}.java.in
  324. ${PROJECT}.java.in: MathFixed.java.in Raster.java.in
  325. ${PROJECT}Applet: MathFixed.class ${PROJECT}.class ${PROJECT}Applet.class
  326. ${PROJECT}.java: ${PROJECT}.java.in Raster.java.in
  327. ${PROJECT}Raster.java: ${PROJECT}Raster.java.in
  328. ${PROJECT}CommandLine.class: ${PROJECT}CommandLine.java
  329. ${JAVAC} -classpath /opt/jars/gif89.jar:${DESTDIR} -d ${DESTDIR} $<
  330. gif anim: ${PROJECT}Applet ${PROJECT}.gif
  331. echo display $<
  332. ${PROJECT}.gif: ${PROJECT}CommandLine.class
  333. ${JAVA} -classpath /opt/jars/gif89.jar:${DESTDIR} ${<F:.class=} $@
  334. #${PROJECT}Render.java: ${SRC_DIR_ABS}${PROJECT}Render.java
  335. #${PROJECT}Canvas.java: ${SRC_DIR_ABS}${PROJECT}Canvas.java
  336. #${PROJECT}MIDlet.java: ${SRC_DIR_ABS}${PROJECT}MIDlet.java
  337. #resource.java: ${SRC_DIR_ABS}resource.java
  338. #${DEST_DIR}%.java: ${SRC_DIR_ABS}%.java
  339. # MIDlet-Icon: ${PROJECT}.png
  340. #${PROJECT}RenderAwt.java: ${PROJECT}Render.java
  341. # echo "//DO NOT EDIT THIS FILE IT IS GENERATED FROM $^ " > $@
  342. # sed -e "s/\s*\/\/\(.*@use_awt\)/\1/g" < $^ | \
  343. # sed -e "s/\(.*@use_${ENV}\)/\/\/\1/g" >> $@
  344. #${PROJECT}Render.class: ${PROJECT}Render.java
  345. # ${JAVAC} -d ${DESTDIR} $^
  346. # touch $@
  347. #${SRCS}: GNUmakefile
  348. exec-micro:
  349. ${MAKE} RT=midp1_0 exec-memu
  350. exec-memu: ${DESTDIR}${PROJECT}.html ${DESTDIR}../lib/me-applet.jar modes
  351. echo "$@ : $<"
  352. ls ${DESTDIR}
  353. -${MAKE} browse URL="${URL_BASE}$<"
  354. -${APPLETVIEWER} ${URL_BASE}$<
  355. # appletviewer ${CURDIR}/$<
  356. ${DESTDIR}../lib/me-applet.jar:
  357. ${MKDIR} ${@D}
  358. cp ${WEBDIR}lib/me-applet.jar $@
  359. browse:
  360. ${MAKE} browse-arg "ARG=${URL}"
  361. browse-arg:
  362. lynx -dump -head ${ARG}
  363. lynx -dump -source ${ARG}
  364. lynx -dump ${ARG}
  365. xbrowse:
  366. lynx -dump -head ${URL}
  367. mozilla ${URL}
  368. #TODO #xmllint
  369. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  370. # J2ME Section
  371. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  372. INDENT_ARGS?=-i2 -nbc -ce -npcs -npsl -bli0 -bl -nce -bbo -cbi2 -lp -ci4 -cli2 -i2
  373. %.class:%.java
  374. # @echo "#{ $@ : $^"
  375. ${MKDIR} ${OBJ_DIR}
  376. ${JAVAC} ${JAVACFLAGS} ${SRC_DIR_ABS}${^F}
  377. # @echo "#} $@ : $^"
  378. %.java: %.java.in ${SRCS_IN}
  379. ${MKDIR} ${SRC_DIR_ABS} ${TMPDIR}/${@D}
  380. cpp -undef -fno-show-column ${DEFINES} -C -P -I. -I ${SRC_IN_DIR} $< \
  381. > "$@.tmp"
  382. @indent ${INDENT_ARGS} < "${@}.tmp" > "${SRC_DIR_ABS}$@" || mv "${@}.tmp" "${SRC_DIR_ABS}$@"
  383. rm "${@}.tmp"
  384. # @echo -e "\n ### !!! MAKE MAY FAILS, just restart (vpath bug) ### \n"
  385. # @ls -l ${SRC_DIR_ABS}$@
  386. # sed -e "s/\s*\/\/@cpp \(.*\)/\1/g" < $< | \
  387. %.java %.MF %.in: GNUmakefile
  388. jar ${PROJECT}.jar: ${DESTDIR} GNUmakefile ${DESTDIR}${PROJECT}.jar
  389. ${SRC_DIR_ABS}MANIFEST.MF: ${SRC_IN_DIR}MANIFEST.MF.in
  390. @echo "#+ $@"
  391. ${MKDIR} ${SRC_DIR_ABS}
  392. cat $< | \
  393. sed -e "s/\(MicroEdition-Profile: \)MIDP-[0-9]*.[0-9]*/\1${MIDPV}/g" |\
  394. sed -e "s/\(MIDlet-Version: \)[0-9]*.[0-9]*/\1${VERSION_DOT}/g" \
  395. > $@
  396. @echo "#- $@"
  397. # s/\(MIDlet-Version:\) .*/\1 ${VERSION}/g
  398. # MIDlet-Icon: /JBenchmark2/JBenchmark.png
  399. default-MANIFEST.MF:
  400. @echo "MIDlet-1: ${PROJECT}, ${PROJECT}.png, ${PROJECT}MIDlet"
  401. @echo "MIDlet-Name: ${PROJECT}"
  402. @echo "MIDlet-Description: please describe"
  403. @echo "MIDlet-Vendor: ${USER}@${HOSTNAME}"
  404. @echo "MIDlet-Info-URL: ${URL} "
  405. @echo "MicroEdition-Configuration: CLDC-1.0"
  406. @echo "MicroEdition-Profile: MIDP-1.0"
  407. @echo "MIDlet-Version: ${VERSION_DOT}"
  408. #${PROJECT}MIDlet$$Tick.class ${PROJECT}Render.class
  409. ${DESTDIR}${PROJECT}.jar:${SRC_DIR_ABS}MANIFEST.MF ${OBJS} ${DESTDIR}
  410. @echo "#{ $@"
  411. cd ${OBJ_DIR} && \
  412. ${PREVERIFY} -classpath ${CLASSPATH} -d . . && \
  413. ${JAR} cvfm ${DESTDIR_ABS}${PROJECT}.jar ${SRC_DIR_ABS}MANIFEST.MF .
  414. file ${DESTDIR}${PROJECT}.jar
  415. -${CLEAN} ${DESTDIR}${PROJECT}.jad
  416. @echo "# $(^F) $(^F:.class=)"
  417. @echo "#} $@"
  418. jar-size: ${DESTDIR}${PROJECT}.jar
  419. @stat $^ | grep "Size:" | sed -e "s/ *Size: \([0-9]*\).*/\1/g" | head -1
  420. SIZE:=` \
  421. stat ${DESTDIR}${PROJECT}.jar \
  422. | grep "Size:" | sed -e "s/ *Size: \([0-9]*\).*/\1/g" | head -1 \
  423. `
  424. size:
  425. @echo "$^ Size = ${SIZE}"
  426. check: ${API} ${DESTDIR}${PROJECT}.jad ${DESTDIR}${PROJECT}.jar
  427. @echo "#+ $@"
  428. @ls -l ${DESTDIR}${PROJECT}.jar
  429. @grep Size: ${DESTDIR}${PROJECT}.jad
  430. @echo "#- $@"
  431. jad: ${DESTDIR}${PROJECT}.jad
  432. jad-rm:
  433. @-${CLEAN} ${DESTDIR}${PROJECT}.jad
  434. echo "#- $@"
  435. jad-re: jad-rm jad check
  436. jad-all:
  437. ${MAKE} RT=midp1_0 jad-re
  438. ${MAKE} RT=midp2_0 jad-re
  439. ${MAKE} RT=midp1_0-nokia jad-re
  440. size-bug:
  441. stat ${DESTDIR}${PROJECT}.jar | grep "Size:" \
  442. | sed -e "s/ *Size: \([0-9]*\).*/\1/g"
  443. cat $< | grep "MIDlet-Jar-Size:" \
  444. | sed -e "s/MIDlet-Jar-Size: \([0-9]*\)\s*/\1/g"
  445. # TODO: size ?
  446. ${DESTDIR}${PROJECT}.jad: ${SRC_DIR_ABS}MANIFEST.MF ${DESTDIR}${PROJECT}.jar
  447. @echo "#{ $@ ${SIZE}"
  448. cat $< > $@
  449. echo "MIDlet-Jar-URL: ${PROJECT}.jar" >> $@
  450. echo "MIDlet-Jar-Size: ${SIZE}">> $@
  451. echo "" >> $@
  452. sed -e "s/MIDlet-Jar-Size: \([0-9]*\)/MIDlet-Jar-Size: \1/g" < $@
  453. @echo "#} $@"
  454. # echo "MIDlet-Version: ${VERSION_DOT}">> $@
  455. ${DESTDIR}${PROJECT}.jam: ${DESTDIR}${PROJECT}.jar ${SRC_DIR_ABS}MANIFEST.MF GNUmakefile
  456. stat ${DESTDIR}${PROJECT}.jar | grep "Size:" \
  457. | sed -e "s/ *Size: \([0-9]*\).*/\1/g"
  458. cat $@ | grep "MIDlet-Jar-Size:" \
  459. | sed -e "s/MIDlet-Jar-Size: \([0-9]*\)\s*/\1/g"
  460. @echo "AppName = ${PROJECT}" > $@
  461. @echo "ConfigurationVer = CLDC-1.0" >>$@
  462. @echo "ProfilVer = DoJa-1.5oe" >>$@
  463. @echo "AppClass = ${PROJECT}Imode" >>$@
  464. @echo "PackageURL = ${PROJECT}.jar" >> $@
  465. @echo "AppSize = ${SIZE}">> $@
  466. @echo "LastModified = `date -R -u`" >> $@
  467. @echo "" >> $@
  468. @cat $@
  469. @echo "#- $@"
  470. # cat ${SRC_DIR_ABS}${PROJECT}.jam > $@
  471. # #sed -e "s/MIDlet-Jar-Size: \([0-9]*\)/MIDlet-Jar-Size: \1/g" < $@
  472. # Sun, 20 Jun 2004 06:17:48 = good
  473. # dim avr 11 12:34:33 CEST 2004 = bad
  474. wml: ${DESTDIR}${PROJECT}.wml
  475. ${DESTDIR}${PROJECT}.wml: ${DESTDIR}${PROJECT}.jad
  476. @echo "<?xml version=1.0?>\n\
  477. <!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"\n\
  478. \"http://www.wapforum.org/DTD/wml1.1.xml\">\n\
  479. <wml>\n\
  480. <card>\n\
  481. <p>\n\
  482. <a href=\"${URL_PUB}${PROJECT}.jad\">${PROJECT}.jad</a>\n\
  483. </p>\n\
  484. </card>\n\
  485. </wml>\
  486. " > $@
  487. @echo "#- $@"
  488. ${DESTDIR}imode.html:
  489. echo "<object declare id=${PROJECT} data=${URL_JAM} \
  490. type=\"application/x-jam\"></object>\
  491. <a ijam=\"#${PROJECT]\" href=fail.htm>Download</a>\
  492. " > $@
  493. applethtml: ${DESTDIR}${PROJECT}Applet.html
  494. ${DESTDIR}${PROJECT}Applet.html: ${PROJECT}Applet.class
  495. @echo "<html>" > $@
  496. @echo "<applet width=200 height=200" >> $@
  497. @echo "code=${<F:.class=}" >> $@
  498. @echo "></applet>" >> $@
  499. @echo "</html>" >> $@
  500. @echo "#} $@"
  501. ${DESTDIR}${PROJECT}.html: ${PROJECT}.jar
  502. @echo "<html>" > $@
  503. @echo "<H1>${PROJECT} Applet @" >> $@
  504. @echo "<a href=${PROJECT_URL}>${PROJECT_URL}</a>" >> $@
  505. @echo "</H1>" >> $@
  506. @echo "<applet code=\"com.barteo.emulator.applet.Main\"" >> $@
  507. @echo " width=170 height=445 " >> $@
  508. @echo " archive=\"../lib/me-applet.jar,${<F}\" " >> $@
  509. @echo ">">> ${DESTDIR}${PROJECT}.html >> $@
  510. @echo "<param name=midlet value=${PROJECT}MIDlet>" >> $@
  511. @echo "</applet><hr><pre>">> $@
  512. ${MAKE} info-user >> $@
  513. @echo "</html>" >> $@
  514. @echo "#} $@"
  515. palmos pda prc:
  516. ${MAKE} RT=midp1_0 ${PROJECT}.prc
  517. ${MAKE} RT=midp2_0 ${PROJECT}.prc
  518. pro-all:
  519. ${MAKE} RT=midp1_0 pro
  520. ${MAKE} RT=midp2_0 pro
  521. ${MAKE} RT=midp1_0-nokia pro
  522. ${PROJECT}.prc: ${DESTDIR} ${DESTDIR}${PROJECT}.jad ${DESTDIR}${PROJECT}.jar
  523. ${CONVERTER} -type Data -jad ${DESTDIR}${PROJECT}.jad ${DESTDIR}${PROJECT}.jar
  524. jar: ${OBJS} ${OBJ_DIR} ${DESTDIR_ABS} ${DESTDIR}${PROJECT}.jar
  525. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  526. # hany rules for testing deploy etc
  527. #
  528. exec exec: modes ${DESTDIR} ${DESTDIR}${PROJECT}.wml url exec-${RT}
  529. test test-all: clean-all compile-all modes exec-all clean-all
  530. test-ri:
  531. ${MAKE} RT=midp1_0 rebuild exec-ri
  532. test-nokia n nokia midp1_0-nokia:
  533. ${MAKE} RT=midp1_0-nokia rebuild exec
  534. test-midp1_0 1 10 midp1_0:
  535. ${MAKE} RT=midp1_0 rebuild exec
  536. test-midp2_0 20 midp2_0:
  537. ${MAKE} RT=midp2_0 rebuild exec
  538. j2se:
  539. ${MAKE} RT=j2se SDKV=0 rebuild exec
  540. build-all compile-all:
  541. ${MAKE} RT=midp1_0
  542. ${MAKE} RT=midp2_0
  543. ${MAKE} RT=midp1_0-nokia
  544. ${MAKE} RT=j2se SDKV=00
  545. ${MAKE} RT=midp1_0-nokia
  546. ${MAKE} RT=imode
  547. ${MAKE} RT=exen
  548. all-post compile-post:
  549. ${MAKE} RT=midp1_0 pro prc
  550. ${MAKE} RT=midp2_0 pro prc
  551. ${MAKE} RT=midp1_0-nokia pro
  552. # uninstall
  553. #jar ${DESTDIR}${PROJECT}.jar ${DESTDIR}${PROJECT}.jad ${DATA} post
  554. #dir ${ALL}
  555. # or post-${RT}
  556. srcs: ${SRCS}
  557. @ls ${SRC_DIR_ABS}
  558. src: ${SRCS_IN}
  559. dir:${DIRPATH}
  560. ${DIRPATH}:
  561. ${MKDIR} $@
  562. compile-force:
  563. @echo "### !!! this workaroud the vpath bug"
  564. -${MAKE} compile
  565. -${MAKE} compile
  566. -${MAKE} compile
  567. -${MAKE} compile
  568. -${MAKE} compile
  569. -${MAKE} compile
  570. ${MAKE} compile
  571. srcin: ${SRCS_IN}
  572. install-data: ${DATA}
  573. echo "### debug here : $^"
  574. ${DATA}: ${OBJS}
  575. cp ${SRC_IN_DIR}$(@F) ${DATA_DIR}
  576. demo:
  577. ${MAKE} RT=midp2_0 exec-ri-url
  578. exec-application: ${PROJECT}Applet
  579. cd ${DESTDIR} && \
  580. ${JAVA} $^
  581. exec-j2se exec-applet: ${DESTDIR}applet.htm
  582. -${APPLETVIEWER} $<
  583. ${DESTDIR}applet.htm post-j2se: ${PROJECT}Applet
  584. cp ${SRC_IN_DIR}applet.htm ${DESTDIR}
  585. names:
  586. -mv readme README
  587. -mv authors AUTHORS
  588. -mv copying COPYING
  589. info infos: info-proj
  590. @echo "# default settings are : "
  591. @echo "# SDKV=\"${SDKV}\""
  592. @echo "# SDK=\"${SDK}\""
  593. @echo "# SDK_DIR=\"${SDK_DIR}\""
  594. @echo "# API=\"${API}\""
  595. @echo "# JAVACFLAGS=${JAVACFLAGS}"
  596. @echo "# SDK_DIR=${SDK_DIR}"
  597. @echo "# CLASSPATH=${CLASSPATH}"
  598. @echo "# PATH=${PATH}"
  599. @echo "# DESTDIR=${DESTDIR}"
  600. @echo "# DESTDIR_ABS=${DESTDIR_ABS}"
  601. @echo "# VPATH=${VPATH}"
  602. info-proj:
  603. @echo "# PROJECT=${PROJECT}"
  604. @echo "# ALL=${ALL}"
  605. @echo "# OBJS=${OBJS}"
  606. @echo "# SRCS=${SRCS}"
  607. cc-wildcards:
  608. ${MKDIR} ${DESTDIR}
  609. ${JAVAC} ${JAVACFLAGS} *.java
  610. pre: ${SDK_DIR} dir
  611. # @echo "#} $@ : $^"
  612. post: modes
  613. rebuild: clean-all all
  614. rebuild-all: clean-all compile-all
  615. reinstall: rebuild-all install
  616. imode all-imode: ${DESTDIR} ${OBJS} jar ${DESTDIR}${PROJECT}.jar ${DESTDIR}${PROJECT}.jam ${DATA}
  617. log.txt: clean default clean
  618. date > $@
  619. date >> $@
  620. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  621. # Deploy
  622. release: clean-all compile-all compile-post exec-all install
  623. install: modes install-classes arch
  624. install-classes install-dist dist-install:
  625. ls ${WEBDIR}
  626. -${CLEAN} -rf ${WEBDIR}${DESTDIR}
  627. cp -rf ${DESTDIR} ${WEBDIR}
  628. cp -rf ./jclasses-* ${WEBDIR}
  629. ls -l ${WEBDIR}${DESTDIR}
  630. install-post:
  631. @echo "MIDlet-Jar-URL: Diet3D.jar"
  632. #TMP_DIR=${HOME}/tmp/${PROJECT}/${DATE}/${PROJECT}/
  633. install-src: AUTHORS README COPYING src-midp1_0 jclasses-midp1_0
  634. -mkdir -p ${TMP_DIR}
  635. cp -rf $^ ${TMP_DIR}
  636. ls -lR ${TMP_DIR}
  637. cd ${TMP_DIR}.. && zip -r9 ${PROJECT_DIST}-src.zip ${PROJECT}
  638. ls -lR ${TMP_DIR}../${PROJECT_DIST}-src.zip
  639. CLEAN=rm -rf
  640. clean-bak:
  641. -@${CLEAN} *~ "#*" "#*.*" \#* *.log log.txt 2>&1 2>/dev/null
  642. -@find . -name "*~" -exec ${CLEAN} {} \; 2>&1 2>/dev/null
  643. -@find . -name "*#*" -exec ${CLEAN} {} \; 2>&1 2>/dev/null
  644. @echo "# $@"
  645. clean-bin:
  646. -@${CLEAN} *.class *.jar \
  647. ${OBJ_DIR}/*.class ${DESTDIR}/*.jad ${DESTDIR}/*.jar \
  648. 2>&1 2>/dev/null
  649. @echo "# $@"
  650. #${DESDIR}
  651. clean: clean-bak clean-bin clean-src
  652. @echo "# $@"
  653. GEN_PATH?=tmpclasses tmplib classes res src bin
  654. clean-all: clean clean-src clean-src-all
  655. -@${CLEAN} -rf ${DESTDIR}../jclasses* ${OBJ_DIR}../jclasses* ${DESTDIR} jclasses-midp* ${GEN_PATH} \
  656. /tmp/tmp-${USER}.tmp/${package}/ 2>&1 2>/dev/null
  657. -@${CLEAN} *.log 2>&1 2>/dev/null
  658. ls
  659. @echo "# $@"
  660. clean-sys:
  661. -@${CLEAN} -rf ${SDK_PATH} 2>&1 2>/dev/null
  662. @echo "# $@"
  663. clean-src:
  664. -@${CLEAN} ${SRC_DIR_ABS}/* 2>&1 2>/dev/null
  665. @echo "# $@"
  666. clean-src-all:
  667. -@${CLEAN} -rf src-10 src-10-nokia src-20 src-exen* src- src-midp* src-exen* src-j2se src-imode 2>&1 2>/dev/null
  668. @echo "# $@"
  669. dir-gen: ${GEN_PATH}
  670. url: modes ${DESTDIR}${PROJECT}.jad ${DESTDIR}${PROJECT}.jar
  671. lynx -dump -head ${URL_BASE}${DESTDIR}${PROJECT}.jar
  672. lynx -dump -head ${URL}
  673. lynx -dump ${URL}
  674. modes:
  675. find ${CURDIR}/ -type f -exec chmod a-x+X {} \;
  676. -@chmod -R a+rX ${HOME}/public_html/
  677. @echo "#- $@"
  678. arc zip arch: ${PROJECT_DIST}-${VERSION_DOT}_${DATE}.zip
  679. ${PROJECT_DIST}.zip ${PROJECT_DIST}-${DATE}.zip ${PROJECT_DIST}-${VERSION_DOT}_${DATE}.zip: clean-bak
  680. -cp ${WEBDIR}/../00index.htm ./
  681. cd .. && ${CLEAN} $@; zip -r -9 $@ ${PROJECT} && ls -l $@
  682. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# SDK
  683. #
  684. clean-sdk:
  685. ${SW_DIR}WTK104/bin/emulator -Xjam:remove=${PROJECT}
  686. ${SW_DIR}WTK104: ${SW_ARC}j2me_wireless_toolkit-1_0_4_01-bin-linuxi386.bin
  687. -cd ${SW_DIR} && umask 000 && \
  688. -${CLEAN} -rf $@ ; ${MKDIR} $@
  689. cd $@ && ${UNZIP} $<
  690. ${SW_DIR}WTK2.1: ${SW_ARC}j2me_wireless_toolkit-2_1-beta-bin-linux-i386.bin
  691. -cd ${SW_DIR} && umask 000 && \
  692. -${CLEAN} -rf $@ ; ${MKDIR} $@
  693. cd $@ && ${UNZIP} $<
  694. ${SW_DIR}midp2.0fcs: ${SW_ARC}midp-2_0-src-linux-i686.zip
  695. -cd ${SW_DIR} && umask 000 && \
  696. -${CLEAN} -rf $@
  697. ${UNZIP} $<
  698. uninstall:
  699. -${SW_DIR}WTK104/bin/emulator -Xjam:remove=all
  700. -${SW_DIR}WTK2.1/bin/emulator -Xjam:remove=all
  701. -${SW_DIR}midp2.0fcs/bin/midp -remove all
  702. uninstall-all:
  703. -${CLEAN} -rf ${SDK_PATH}
  704. # ${CLEAN} -rf "${SW_DIR}WTK104/appdb/www%002e#Philippe%002e#C#O#V#A#L%002efree%002e#F#R_#"*
  705. install-all: ${SDK_PATH}
  706. sdk-check:
  707. ls -l ${SW_DIR}
  708. ls -l ${API}
  709. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# Emulators
  710. #
  711. run: exec-${RT}
  712. exec-all: exec-all-midp1_0 exec-all-midp1_0-nokia exec-all-midp2_0 exec-all-j2se exec-all-exen
  713. exec-all-midp1_0:
  714. ${MAKE} RT=midp1_0 exec-WTK2.1 exec-WTK104
  715. ${MAKE} RT=midp1_0 exec-nokia-40 exec-nokia-60 exec-micro
  716. -${MAKE} RT=midp1_0 exec-midp2.0fcs
  717. exec-all-midp2_0:
  718. ${MAKE} RT=midp2_0 exec-WTK2.1 exec-nokia
  719. -${MAKE} RT=midp2_0 exec-midp2.0fcs
  720. exec-all-midp1_0-nokia:
  721. ${MAKE} RT=midp1_0-nokia exec
  722. ${MAKE} RT=midp1_0-nokia exec-nokia-60
  723. exec-url-all: modes ${SDK_PATH}
  724. exec-url-wtk2: browse
  725. ${SW_DIR}WTK2.1/bin/emulator -Xjam:transient=${URL}
  726. exec-url-wtk1: browse
  727. ${SW_DIR}WTK104/bin/emulator -Xjam:transient=${URL}
  728. exec-url exec-midp2.0fcs exec-ri-url exec-url-20: browse
  729. @echo "### !!! Dont exit after shutdown? Hit ^C ($@)"
  730. -killall -9 midp
  731. -${SW_DIR}midp2.0fcs/bin/midp -autotest ${URL} &
  732. @echo "$@ ${URL}"
  733. # -killall -9 midp
  734. ri exec-ri: ${DESTDIR}${PROJECT}.jad modes
  735. ${MAKE} exec-ri-url RT=${RT}
  736. #exec-WTK104 exec-WTK2.1 ${PROJECT}: ${SDK_DIR} url
  737. # ${VM} -Xdescriptor:${URL}
  738. exec-sdk-wtk: ${DESTDIR}${PROJECT}.jad
  739. cd ${<D} && ${SDK_DIR}/bin/emulator -Xdescriptor:${<F}
  740. exec-midp2_0 exec-wtk exec-21 exec-WTK2.1: exec-sdk-wtk
  741. # ${SDK_DIR}/bin/emulator -Xdescriptor:$^
  742. # ${SW_DIR}WTK2.1/bin/emulator -Xdescriptor:$^
  743. exec-midp1_0 exec-bw exec-WTK104: ${DESTDIR}${PROJECT}.jad
  744. ${SW_DIR}WTK104/bin/emulator -Xdescriptor:$^
  745. EMU_HOME?=${SW_DIR}Nokia/Devices/Nokia_Series_40_MIDP_Concept_SDK_Beta_0_3/
  746. exec-midp1_0-nokia exec-nokia-40 exec-Nokia: ${DESTDIR}${PROJECT}.jad
  747. java -cp ${EMU_HOME}tools/emulator.jar -Demulator.home="${EMU_HOME}" com.nokia.phone.sdk.Emulator -uei $<
  748. exec-nokia exec-nokia-60 exec-n60: ${DESTDIR}${PROJECT}.jad
  749. ${SW_DIR}Nokia/Devices/Series_60_MIDP_Concept_SDK_Beta_0_3_1_Nokia_edition/bin/emulator $^
  750. exec-all-j2se:
  751. ${MAKE} RT=j2se exec
  752. # standalone
  753. start: start-WTK104
  754. emu wtk start start-midp20 start-WTK2.1:
  755. ${SW_DIR}WTK2.1/bin/emulator -Xjam:force
  756. start-midp10 start-WTK104:
  757. ${SW_DIR}WTK104/bin/emulator -Xjam:force
  758. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  759. # www.in-fusio.com 's Exen
  760. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  761. ${SRC_DIR_ABS}${PROJECT}.xml: ${SRC_IN_DIR}${PROJECT}.xml
  762. ${MKDIR} ${@D}
  763. cp $^ $@
  764. exenc: ${DESTDIR}${EXEN_TARGET}
  765. ${DESTDIR}${EXEN_TARGET}: ${SRC_DIR_ABS}${PROJECT}.xml
  766. @echo "#+ $@"
  767. @echo source ${SDK_DIR}bin/setupenv
  768. @echo INFUSIO_PP_LIN=${INFUSIO_PP_LIN}
  769. cd ${SDK_DIR}bin && exenc $<
  770. @cp ${SRC_DIR_ABS}${@F} ${@}
  771. @echo "#- $@"
  772. # @-${CLEAN} ${<D}*.class
  773. pcp: ${DESTDIR}${EXEN_TARGET:.exn=.pcp}
  774. %.pcp: %.exn
  775. ${EXN2CTC} $^
  776. #${DESTDIR}${EXEN_TARGET}: ${SRC_DIR_ABS}${EXEN_TARGET}
  777. # ${MKDIR} ${@D}
  778. # cp -a $< ${@D}
  779. # ${EXN2CTC} $@
  780. # ${DESTDIR}${EXEN_TARGET}
  781. all-exen:
  782. make RT=exen \
  783. ${DESTDIR}${EXEN_TARGET}
  784. @echo "### - $@"
  785. all-exen exen-post: ${DESTDIR}${EXEN_TARGET}
  786. exec-all-exen:
  787. @echo "### + $@"
  788. ${MAKE} RT=exen all-exen pcp exec
  789. @echo "### - $@"
  790. exec-exen: ${DESTDIR}${EXEN_TARGET}
  791. @echo "#+ $@"
  792. ls -l $<
  793. cd ${<D} && \
  794. echo ${VM_EXEN} ${<F}
  795. @echo "#- $@"
  796. exec-exen-arg:
  797. @echo "#+ $@"
  798. ls -l $<
  799. cd ${<D} && \
  800. ${VM_EXEN} ${<F}
  801. @echo "#- $@"
  802. install-exen: ${EXEN_ROM}
  803. clean-exen:
  804. -@rm -rf *-exen
  805. @echo "#- $@"
  806. exen:
  807. echo source ${SDK_DIR}bin/setupenv
  808. ${MAKE} RT=$@ all all-exen
  809. #exenexen-obj exen-pvc-fast exen-rom
  810. #${DEST_DIR}${ARG}: all-exen
  811. exen-obj exen-classes: ${SRCS}
  812. ${MKDIR} ${DESTDIR}
  813. ${JAVACP} $^
  814. exen-pvc: ${FILES:=.pvc}
  815. %.pvc: %.class
  816. cd ${^D} && \
  817. ${WMTRANS} ${^F:.class=}
  818. # SVM Classfile Translator 1.0 (Build 10205)
  819. # && ls
  820. # -do "." -v -gp -g4 -dt -vt ${PROJECT}Render
  821. #&& ls
  822. # ${WMTRANS} -gp -v -w -vd $(^F:.class=) && ls # -vt -ve ...
  823. #INFUSIO_PP_LIN=\/home\/rzr\/mnt\/infusio
  824. #VMTRANS += -gp -v -w
  825. VMTRANS_FLAGS += -do "PVC file" -v -gp -g4 -dt -vt "Target"
  826. exen-build:
  827. ${MAKE} RT=exen src exen-obj exen-pvc pvc-link exen-rom
  828. pvc-link exen-pvc-fast: ${OBJS}
  829. -@${CLEAN} ${OBJ_DIR}*.pvc
  830. cd ${OBJ_DIR} && \
  831. ${WMTRANS} ${WMTANS_FLAGS}\
  832. ${OBJS:.class=} && ls
  833. @echo "#- $@"
  834. #vmtrans -do "PVC file" -v -gp -g4 -dt -vt "Target file"
  835. post-exen: exen-pvc-fast le_default.exn
  836. #exen-rom: ${DEST_DIR}${EXEN_TARGET}
  837. # echo "$<"
  838. #${OBJS:.class=.pvc}
  839. bug-exen-rom:
  840. @echo "... creating rom"
  841. -@${CLEAN} ${OBJ_DIR}*.exn
  842. cd ${OBJ_DIR} && ls && \
  843. ${PVC2ROM} -gv -dc . -dr ${EXEN_ROM} -do ${F}
  844. @echo "#- $@"
  845. test-exen: src-exen/ExEn/${EXEN_TARGET}
  846. ${MAKE} RT=exen exec-exen ARG="${<D}/${<F}"
  847. bug-exen:
  848. ${MAKE} RT=exen default post-exen-pvc post-exen
  849. # ${WMTRANS} -h
  850. bug-all-exen:
  851. ${MAKE} RT=exen src exen-exenc
  852. bug-test-exen: le_default.exn
  853. ls -l $<
  854. ${MAKE} exec-exen ARG=$<
  855. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  856. ${SRC_DIR}${PROJECT}.pro: ${OBJ_DIR}
  857. @echo "#+ $@"
  858. @echo ""
  859. @echo "#### Optimising Bytecode"
  860. @echo "#"
  861. @echo "" > $@
  862. @echo "-libraryjars ${API}:${API_MIDP}" >> $@
  863. @echo "-injars ${DESTDIR}${PROJECT}.jar" >> $@
  864. @echo "-outjar ${OBJ_DIR}${PROJECT}obfuscated.jar" >> $@
  865. @echo "-overloadaggressively" >> $@
  866. @echo "-defaultpackage ''" >> $@
  867. @echo "-keep public class * " >> $@
  868. cat $@
  869. @echo "#- $@"
  870. OBFUSCATE=java -jar /mnt/c/usr/jclasses/proguard.jar
  871. ${OBJ_DIR}${PROJECT}obfuscated.jar: ${DESTDIR}${PROJECT}.jar
  872. @echo "#+ $@"
  873. ${OBFUSCATE} @${SRC_DIR}${PROJECT}.pro
  874. ls -l $<
  875. ls -l $@
  876. @echo "#- $@"
  877. pro-post: ${OBJ_DIR}${PROJECT}obfuscated.jar pro-preverif ${DESTDIR_ABS}
  878. @echo "#+ $@"
  879. mv $< ${DESTDIR_ABS}${PROJECT}.jar
  880. @echo "#- $@"
  881. pro-preverif-jar: ${OBJ_DIR}${PROJECT}obfuscated.jar
  882. ${PREVERIFY} -classpath ${API}:${API_MIDP} $<
  883. @echo "#- $@ # doesnt work"
  884. PREVERIFYDIR=${OBJ_DIR}../obfuscated-${RT}/
  885. pro-preverif: ${OBJ_DIR}${PROJECT}obfuscated.jar
  886. @echo "#+ $@"
  887. ls -l $<
  888. -${CLEAN} ${PREVERIFYDIR}
  889. ${MKDIR} ${PREVERIFYDIR}
  890. cd ${PREVERIFYDIR} && \
  891. jar xvf $< && \
  892. ${PREVERIFY} -classpath ${API}:${API_MIDP} -d . . && \
  893. jar cvfm $< ${SRC_DIR_ABS}MANIFEST.MF .
  894. @echo "#- $@"
  895. obfuscate obfuscated proguard pro: ${SRC_DIR}${PROJECT}.pro pro-post jad-re
  896. api: doc-api-${RT} force
  897. doc-api-${RT}:
  898. javadoc -d $@ ${SRC_DIR}/*.java
  899. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  900. info-project:
  901. @echo DESTDIR=${DESTDIR}
  902. @echo DESTDIR_ABS=${DESTDIR_ABS}
  903. @echo SRC_DIR_ABS=${SRC_DIR_ABS}
  904. @echo OBJ_DIR=${OBJ_DIR}
  905. # imported rules
  906. apt:
  907. sudo aptitude install make free-java-sdk indent android-sdk android-emulator
  908. version:
  909. ${JAVA} -version
  910. ${JAVAC} -help
  911. ${MAKE} --version
  912. ${SH} --version
  913. ${PREVERIFY} -version
  914. info-user:
  915. @echo PROJECT=${PROJECT}
  916. @echo PROJECT_URL=${PROJECT_URL}
  917. @echo USER=${USER}
  918. @echo OSTYPE=${OSTYPE}
  919. @echo OS=${OS}
  920. @echo DATE=${DATE}
  921. @echo VERSION=${VERSION}
  922. uname -a
  923. arch
  924. hostname
  925. cvs-tag:
  926. @echo cvs tag "${PROJECT}-${VERSION_CHAR}-${DATE}-${PROFILE}"
  927. force:
  928. @echo "#} $@ : $^"
  929. # @echo EMAIL=${EMAIL}
  930. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  931. android_DIR=src/fr/online/rzr/
  932. #android_DIR=~/workspace/diet3dandroid/src/fr/online/rzr/
  933. android: android-configure android-build
  934. android-configure:
  935. ${MAKE} RT="android" clean srcs
  936. mkdir -p "${android_DIR}" "res"
  937. cp -rfa src-android/* "${android_DIR}/"
  938. android-build:
  939. @echo "exec eclipse # or hack ant makefiles"
  940. android_opt=/opt/android-sdk/
  941. #ADB?=adb
  942. #ADB?=${android_opt}/tools/adb
  943. ADB_DEVICE?=/usr/local/bin/adb-nitdroid
  944. ADB?=${ADB_DEVICE}
  945. run-android: android-run
  946. android-all: ${SRCS} help-android
  947. android-emu: ${android_opt}tools/emulator
  948. ps auxf | grep "$<" | grep -v grep || $< &
  949. ${<D}/adb wait-for-device
  950. android-install: ./bin/Diet3D.apk android-emu
  951. ${ADB} install $<
  952. android-run:
  953. adb shell am start -a android.intent.action.MAIN -n ${package_path}/${package_path}.${activity}
  954. # android-install
  955. echo "TODO"
  956. android-upload: ./bin/Diet3D.apk
  957. -sudo killall adb
  958. ${ADB_DEVICE} uninstall "${package_path}"
  959. ${ADB_DEVICE} install -r $<
  960. android-help:
  961. @echo "build it using eclipse"
  962. # -sudo ${ADB_DEVICE} jdwp
  963. # -sudo ${ADB_DEVICE} logcat
  964. android-adb-stop:
  965. -sudo killall adb
  966. -sudo killall ${ADB_DEVICE}
  967. ps aux | grep adb
  968. android-stop:
  969. -sudo killall adb qemu emulator
  970. stop: android-stop
  971. -killall java eclipse
  972. -sudo killall java eclipse
  973. ide:
  974. /opt/eclipse/eclipse || eclipse #TODO
  975. diff:
  976. cvs diff
  977. distclean: clean
  978. find . -iname "*.class" -exec rm -v '{}' \;
  979. ###
  980. -include ~/bin/mk-${PROJECT_DIST}.mk
  981. #eof "$Id: GNUmakefile $"