summaryrefslogtreecommitdiffstats
path: root/languages/java/app_templates/superwaba/src-Makefile
blob: f2a2a1ab91836244c60bc85564b7feadfbd78dcb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# Makefile template
#
# for using WABA and SUPERWABA on Linux systems
#
# Doug Lawson (dlawson@cablespeed.com)
# Modified for use with KDevelop by Ian Reinhart Geiser <geiseri@kde.org>

# Copyright (c) Doug Lawson 2003
# developed for classes I teach.
#
# may be distributed under GPL
# (http://www.gnu.org/licenses/gpl.html)
# or any other license that allows it to be freely used.
#
# please let me know about any improvements you make

VERSION                = %{VERSION}
# What are we building? We put the names here at the
# top to make it easy to change

MAINCLASSNAME          = %{APPNAME}

# ExtraClassList will be blank if the app consists of
# only one class
EXTRACLASSLIST         =

# Is there an icon for this program? If there
# is, create an icon argument for exegen
#
# Exegen will automatically look for icons
# so this may not be needed. Run
#        java Exegen /?
# for help on Exegen
#
# If you use this line, make sure to un-comment it!
#
# ICONFLAG               = /I Icon

# Like ICONFLAG, height and width may be specified, or
# you may accept the default. On PalmOS, the app will run
# full-screen by default, which is usually what you want.
#
# If you want the same look on PalmOS as on
# Windows CE, you should specify height and width
#
# run
#       java Exegen /?
# for more information, or see the docs.
#
# HEIGHT                 = /h 160
# WIDTH                  = /w 160

# CAB Options
# The /Z parameter is used to create eight cab files so your application can
# easily be installed in all compatible Windows CE platforms. You may pass,
# optionally, a .swz file with some global and local libraries used by your
# app. For example, if you need to install the TinyLarge.pdb font and also a
# custom database, E.g. mydata.pdb, you must copy all files to the current
# directory, then create a myapp.swz file with the following contents:
#
# [G]TinyLarge.pdb
# [L]mydata.pdb
#
# The [G] denotes a global library (fonts are always global libraries), and the
# [L] denotes a local library.
# The user will then have two options to start the installation process:
# 1. Run the created xxx_install.bat file, or
# 2. If the cab files are available in the internet, the user may launch the
# browser from inside the device, connect to the site and choose the appropriate
# cab file. The browser will then download and install the file.
# The /Z parameter works on in the Windows platform.
SWZFILE                = 
CABFLAGS               = /Z $(SWZFILE)

# ------------------------------------------------------
#   Most of the stuff below this line will not change
#   very often. If you change Java SDKs or re-install
#   waba or superwaba, you may need to change it.

# first, the locations of the various java components.
# On a *NIX system, they will usually be in something
# like the directories listed here.


# The flags and arguments here have been developed for use with
# the SUN jdk v1.3. Read your java documentation carefully,
# don't just blindly assume that what I have here will work
# with your setup.

JAVADIR         = %{JAVADIR}
JAVABINDIR      = $(JAVADIR)/bin
JAVAC           = $(JAVABINDIR)/javac
JAR             = $(JAVABINDIR)/jar

# Java Compiler flags and arguments. For these makefiles,
# it is easiest if we include the CLASSPATH in the command
# line.
JCFLAGS         = -classpath $(CLASSPATH)

JAVA            = $(JAVABINDIR)/java
JAVAFLAGS       = -classpath $(CLASSPATH)

APPLETVIEWER    = $(JAVABINDIR)/appletviewer
AVFLAGS         = -J-classpath -J$(CLASSPATH)


# next, where are all  the WABA bits and pieces?
WABADIR         = %{WABADIR}
WABABINDIR      = $(WABADIR)/superwaba/bin
WABAEXTRADIR    = $(WABADIR)/superwaba

################################################################################
# You should not have to change anything below this line.
################################################################################
# the classpath will have to tell java where to find the waba stuff.
#
# the CLASSPATH here is set to let java tqfind
# - the classes it needs to produce the executable class files
# - the waba.applet class, Warp.class, and Exegen.class
#
# This strategy works so far, but it may (conceivably) produce a
# conflict at some point. Be warned. You may want to use a CLASSPATH
# that leaves out waba.applet, Warp and/or Exegen.
#
CLASSPATH       = $(WABADIR):$(WABAEXTRADIR):$(WABAEXTRADIR)/classes:$(WABABINDIR):.

# exegen and warp
#
# exegen is the EXEcutable GENerator. It takes the
# main waba/java class (which usually extends MainWindow)
# and makes it into a program that will automagically run
# itself under waba or superwaba on a PalmOS gadget.
#
# Since the palm program has a .prc extension, it is called
# PRCFILE here.
#
# Exegen also creates a .exe file for Window CE
#
# warp is the Waba Application Resource Packager.
# It bundles  the classes and other resources into
# a single PALM database file (which is also used
# by the Win CE executable). This file has a .pdb
# extension. In this makefile it is called PDBFILE
#
# The standard  waba SDK has only the MS-Windows *.exe files.
# for exegen and warp
#
# Although there are exegen and warp native binaries for Linux,
# they don't seem to work very well. The solution has been to
# write those programs in Java.
#
# for waba, use the java apps
# from http://www.wn.com.au/rnielsen/wextras/
# (Rob Nielsen). Getting all the paths to fall into the right
# place takes a little tuning, though (which is why this makefile
# is here, I suppose)
#
# For superwaba, the same programs are included in the
# distribution


EXEGEN          = $(JAVA) $(JAVAFLAGS) Exegen
EXEGENFLAGS     = $(HEIGHT) $(WIDTH) $(ICONFLAG) /L /V $(VERSION) $(CABFLAGS)

WARP            = $(JAVA) $(JAVAFLAGS) Warp
WARPFLAGS       = c

MAINCLASS       =  $(MAINCLASSNAME).class
EXTRACLASSES    =  $(EXTRACLASSLIST)

WEBPAGE         =  $(MAINCLASSNAME).html

PRCBASENAME     = $(MAINCLASSNAME)
PDBBASENAME     = $(MAINCLASSNAME)

PDBFILE         = $(PDBBASENAME).pdb
PRCFILE         = $(PRCBASENAME).prc


all: $(PDBFILE) $(PRCFILE)

$(PRCFILE): $(PDBFILE)
	$(EXEGEN) $(EXEGENFLAGS) $(PRCBASENAME) $(MAINCLASSNAME) $(PDBBASENAME)

# you may want to change this one so that Warp only handles
# the classes you tell it to (instead of using the wildcard '*.class')
# Use the second pair of lines below, which are commented out.
#
# Note that there is a potential problem if your program generates
# inner classes (which have names like
# 'ClockPanel$SettingsWindow.class'.
# If that is the case, the wildcard  *.class filespec is guaranteed to
# include them in the make dependency.

$(PDBFILE): $(MAINCLASS) $(EXTRACLASSES)
	$(WARP) $(WARPFLAGS) $(PDBBASENAME) *.class

# $(PDBFILE): $(MAINCLASS) $(EXTRACLASSES)
#	$(WARP) $(WARPFLAGS) $(PDBBASENAME) $(MAINCLASS) $(EXTRACLASSES)

#  Below, we just tell make how to create foo.class if it can tqfind
#  foo.java

%.class: %.java
	$(JAVAC) $(JCFLAGS) $<

# note that the 'test' target DOES NOT INCLUDE A DEPENDENCY
# for the java classes. This way, you can keep doing tests of the old
# class while you rewrite the source (foo.java).

test:
	echo "running this test does not rebuild any of the targets" ;\
	$(JAVA) $(JAVAFLAGS) waba.applet.Applet  $(MAINCLASSNAME)

# Since I haven't (yet) got the code written to generate the
# web page, target 'applettest' is commented out. If you want
# to create the web page by hand and test it, be my guest.

# applettest: $(WEBPAGE)
# 	$(APPLETVIEWER) $(AVFLAGS) $(webpage)

clean:
	rm -f *.class *.pdb *.prc *.lnk

jar: $(MAINCLASS) $(EXTRACLASSES)
	$(JAR) -cvfm $(MAINCLASSNAME).jar $(MAINCLASSNAME).mft $(MAINCLASS) $(EXTRACLASSES)