Created
October 17, 2009 20:42
-
-
Save avdi/212448 to your computer and use it in GitHub Desktop.
Avdi's WebOS Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APPNAME = org.avdi.myapp | |
VERSION = 1.0.0 | |
DEVICE = tcp | |
PACKAGEFILE = $(APPNAME)_$(VERSION)_all.ipk | |
VMNAME = "Palm Emulator (1.2.0.33)" | |
EMUPORT = 5522 | |
M4 = m4 | |
PACKAGE = palm-package | |
INSTALL = palm-install | |
INSTALLFLAGS = -d $(DEVICE) | |
LAUNCH = palm-launch | |
LAUNCHFLAGS = $(INSTALLFLAGS) | |
DEBUGFLAGS = $(LAUNCHFLAGS) -p "{mojoConfig:true, debuggingEnabled:true}" -i | |
NOVACOMD = script/novacomd | |
EMULATOR = palm-emulator | |
VBOXMANAGE = vboxmanage | |
VMINFO = $(VBOXMANAGE) showvminfo | |
VMINFOFLAGS = --machinereadable | |
default: package | |
package: $(PACKAGEFILE) | |
install: package emulator | |
$(INSTALL) $(INSTALLFLAGS) $(PACKAGEFILE) | |
remove: | |
$(INSTALL) $(INSTALLFLAGS) --remove $(APPNAME) | |
launch: install | |
$(LAUNCH) $(LAUNCHFLAGS) $(APPNAME) | |
debug: install | |
$(LAUNCH) $(DEBUGFLAGS) $(APPNAME) | |
vmrunning: | |
$(VMINFO) $(VMNAME) $(VMINFOFLAGS) | grep -q 'VMState="running"' | |
vmhalted: | |
$(VMINFO) $(VMNAME) $(VMINFOFLAGS) | grep -q 'VMState="poweroff"' | |
emulator: novacomd | |
$(MAKE) vmrunning || $(EMULATOR); | |
novacomd: novacomd.pid | |
novacomd.pid: | |
$(NOVACOMD) start | |
$(PACKAGEFILE): appinfo.json app/views/*/*.html app/assistants/*.js stylesheets/*.css | |
$(PACKAGE) $(PACKAGEFLAGS) . | |
appinfo.json: appinfo.json.m4 Makefile | |
$(M4) $(M4FLAGS) -DVERSION=$(VERSION) $< > $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
PIDFILE=novacomd.pid | |
NOVACOMD=/usr/local/bin/novacomd/novacomd | |
case $1 in | |
start) | |
$NOVACOMD & | |
echo $! > $PIDFILE | |
;; | |
stop) | |
kill `cat $PIDFILE` | |
;; | |
restart) | |
$0 stop | |
$0 start | |
;; | |
status) | |
ps `cat $PIDFILE` | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment