Annotation of checkyesss/src/Makefile, revision 1.25
1.2 treitmay 1: # ***** BEGIN LICENSE BLOCK *****
2: # - Version: MPL 1.1/GPL 2.0/LGPL 2.1
3: # -
4: # - The contents of this file are subject to the Mozilla Public License Version
5: # - 1.1 (the "License"); you may not use this file except in compliance with
6: # - the License. You may obtain a copy of the License at
7: # - http://www.mozilla.org/MPL/
8: # -
9: # - Software distributed under the License is distributed on an "AS IS" basis,
10: # - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11: # - for the specific language governing rights and limitations under the
12: # - License.
13: # -
14: # - The Original Code is CheckYesss.
15: # -
16: # - The Initial Developer of the Original Code is
17: # - Thomas Reitmayr <treitmayr@yahoo.com>.
1.21 treitmay 18: # - Portions created by the Initial Developer are Copyright (C) 2005-2007
1.2 treitmay 19: # - the Initial Developer. All Rights Reserved.
20: # -
21: # - Contributor(s):
22: # - -
23: # -
24: # - Alternatively, the contents of this file may be used under the terms of
25: # - either the GNU General Public License Version 2 or later (the "GPL"), or
26: # - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27: # - in which case the provisions of the GPL or the LGPL are applicable instead
28: # - of those above. If you wish to allow use of your version of this file only
29: # - under the terms of either the GPL or the LGPL, and not to allow others to
30: # - use your version of this file under the terms of the MPL, indicate your
31: # - decision by deleting the provisions above and replace them with the notice
32: # - and other provisions required by the LGPL or the GPL. If you do not delete
33: # - the provisions above, a recipient may use your version of this file under
34: # - the terms of any one of the MPL, the GPL or the LGPL.
35: # -
36: # - ***** END LICENSE BLOCK *****
37:
1.1 treitmay 38: PROJECT=checkyesss
1.3 treitmay 39: INSTPATH=../downloads
1.24 treitmay 40: VERSINFO.SRCPATH=chrome/locale/de-DE
41: VERSINFO.DSTPATH=~/websites/devbase/trunk/download/checkyesss/moz
42: VERSINFO.FILE=version_info.properties
1.6 treitmay 43: OS=$(shell uname)
1.22 treitmay 44: VERSION=$(shell grep em:version install.rdf | sed 's/.*> *\([0-9]*\.[0-9]*\(\.[0-9]*\)*\).*/\1/' | sed 's/.*em:version="\([0-9]*\.[0-9]*\(\.[0-9]*\)*\).*/\1/')
45: EXTID=$(shell grep "urn:mozilla:extension" checkyesss.xml | head -n 1 | sed 's/.*\(urn:mozilla.*}\).*/\1/')
1.15 treitmay 46: XPIVERSION=$(shell zipgrep em:version checkyesss.xpi install.rdf | sed 's/.*> *\([0-9]*\.[0-9]*\(\.[0-9]*\)*\).*/\1/')
1.10 treitmay 47: ZIPOPT=-X -9 -q
48: JSLOPT=conf ./jsl.conf nologo nofilelisting nosummary
1.1 treitmay 49:
1.6 treitmay 50: ifeq ($(OS), Linux)
1.24 treitmay 51: XPIDL.DIR=$(shell dirname `find /usr/lib/mozilla* /usr/lib/seamonkey -name xpidl 2>/dev/null | head -n 1` )
1.9 treitmay 52: XPIDL.CMD=$(XPIDL.DIR)/xpidl -m typelib -w -v -I $(XPIDL.DIR)/idl -I components -o
1.23 treitmay 53: SIGN.DIR=../3rd-party/spock
1.22 treitmay 54: SIGN.CMD=$(SIGN.DIR)/spock $(PROJECT).xml \
55: -d ~/.mozilla/mccoy/m9st498l.default/ \
56: -i "$(EXTID)" \
57: | ( read a ; echo $$a ; cat LICENSE.xml ; cat )
1.6 treitmay 58: else
59: XPIDL.DIR=/cygdrive/c/Programme/Mozilla.org/Mozilla/base
60: XPIDL.CMD=$(XPIDL.DIR)/xpidl -m typelib -w -v -I $(XPIDL.DIR) -o
61: endif
1.1 treitmay 62:
1.8 treitmay 63: SRC.INST=$(shell find install.* | grep -v \~$) chrome.manifest
1.9 treitmay 64: SRC.CHROME=$(shell find chrome/content chrome/skin chrome/locale -type f | \
1.18 treitmay 65: grep -v \~$ | grep -v CVS | grep -v '/\.' )
1.1 treitmay 66: SRC.COMP.IDL=$(wildcard components/*.idl)
67: SRC.COMP.XPT=$(patsubst %.idl,%.xpt,$(SRC.COMP.IDL))
1.2 treitmay 68: SRC.COMP=$(wildcard components/*.js) $(SRC.COMP.XPT)
69: SRC.DEF=$(shell find defaults -type f | grep -v CVS )
1.9 treitmay 70: ALL.JS=$(wildcard components/cy*.js) \
1.10 treitmay 71: $(shell find chrome/content -name '*.js') \
72: install.js
73:
74: ifeq ($(HOST), de)
1.19 treitmay 75: DESTFILE=CheckYesss_$(VERSION)_fx+ms+sm+tb_de-DE
1.10 treitmay 76: HOSTNAME=erweiterungen.de
1.21 treitmay 77: UPDLINK=https://www.erweiterungen.de/updates/?reqVersion=%REQ_VERSION%\&id=%ITEM_ID%\&version=%ITEM_VERSION%\&maxAppVersion=%ITEM_MAXAPPVERSION%\&status=%ITEM_STATUS%\&appID=%APP_ID%\&appVersion=%APP_VERSION%\&appOS=%APP_OS%\&appABI=%APP_ABI%
1.17 treitmay 78: PROJNAME=CheckYesss [de]
1.10 treitmay 79: else
1.17 treitmay 80: PROJNAME=CheckYesss
1.13 treitmay 81: DESTFILE=$(PROJECT)
1.16 treitmay 82: ifeq ($(HOST), mozdev)
1.10 treitmay 83: HOSTNAME=mozdev.org
84: UPDLINK=http://downloads.mozdev.org/checkyesss/checkyesss.xml
1.16 treitmay 85: else
86: ifeq ($(HOST), local)
87: HOSTNAME=localhost
88: UPDLINK=http://localhost/update-cy.xml
89: else
90: HOSTNAME=devbase.at
1.25 ! treitmay 91: UPDLINK=http://download.devbase.at/update.php?reqversion=%REQ_VERSION%\&id=%ITEM_ID%\&version=%ITEM_VERSION%\&appid=%APP_ID%\&appversion=%APP_VERSION%\&appos=%APP_OS%\&appabi=%APP_ABI%\&status=%ITEM_STATUS%
1.16 treitmay 92: endif
1.10 treitmay 93: endif
94: endif
1.1 treitmay 95:
1.10 treitmay 96:
1.20 treitmay 97: all : lint host $(DESTFILE).xpi $(PROJECT).xml
1.1 treitmay 98:
1.24 treitmay 99: install : $(INSTPATH)/$(PROJECT).xpi $(INSTPATH)/$(PROJECT).xml $(VERSINFO.DSTPATH)/$(VERSINFO.FILE)
1.11 treitmay 100: @echo successfully installed version $(XPIVERSION)
1.3 treitmay 101:
1.5 treitmay 102: clean :
103: rm $(PROJECT).xpi chrome/$(PROJECT).jar $(SRC.COMP.XPT)
104:
1.13 treitmay 105: $(INSTPATH)/$(DESTFILE).xpi : $(DESTFILE).xpi
1.24 treitmay 106: @cp $^ $(INSTPATH)
1.3 treitmay 107:
108: $(INSTPATH)/$(PROJECT).xml : $(PROJECT).xml
1.22 treitmay 109: @echo generating signature
1.23 treitmay 110: @$(SIGN.CMD) > $(INSTPATH)/$^
1.3 treitmay 111:
1.24 treitmay 112: $(VERSINFO.DSTPATH)/$(VERSINFO.FILE) : $(VERSINFO.SRCPATH)/$(VERSINFO.FILE)
113: @echo installing $@
114: @cp $^ $@
115:
1.1 treitmay 116: %.xpt : %.idl
1.10 treitmay 117: @echo compiling $<
118: @$(XPIDL.CMD) $(basename $@) $<
1.1 treitmay 119:
120: chrome/$(PROJECT).jar : $(SRC.CHROME)
1.10 treitmay 121: @rm -rf $@
122: @echo creating $@
123: @cd chrome; zip $(ZIPOPT) -r $(PROJECT).jar $(patsubst chrome/%,%,$^)
1.1 treitmay 124:
1.13 treitmay 125: $(DESTFILE).xpi : $(SRC.INST) $(SRC.COMP) chrome/$(PROJECT).jar $(SRC.DEF)
1.10 treitmay 126: @rm -rf $@
127: @echo creating $@
128: @zip $(ZIPOPT) -r $@ $^
1.11 treitmay 129: @echo successfully built version $(VERSION)
1.9 treitmay 130:
1.20 treitmay 131: $(PROJECT).xml : $(PROJECT).xpi
132: @hash=`sha1sum -b $(PROJECT).xpi` ; \
133: hash=$${hash%% *} ; \
1.24 treitmay 134: sed -i 's#em:updateHash>.*<#em:updateHash>'sha1:$${hash}'<#' $(PROJECT).xml ; \
1.20 treitmay 135: echo updated hash $${hash}
136:
1.9 treitmay 137: .PHONY: lint
138: lint:
1.12 treitmay 139: @echo checking Javascript code
1.10 treitmay 140: @if which jsl >/dev/null ; then \
141: jsl $(JSLOPT) $(patsubst %,process %,$(ALL.JS)); \
142: fi
143:
144: .PHONY: host
145: host:
1.25 ! treitmay 146: @sed 's#em:updateURL>.*<#em:updateURL>$(UPDLINK)<#' install.rdf \
! 147: | sed 's#em:name>.*<#em:name>$(PROJNAME)<#' \
1.17 treitmay 148: > .tmp
1.10 treitmay 149: @if ! diff -q install.rdf .tmp >/dev/null ; then \
150: echo switching to update host $(HOSTNAME) ; \
151: cp .tmp install.rdf ; \
152: else \
1.11 treitmay 153: rm .tmp; \
1.10 treitmay 154: echo using update host $(HOSTNAME); \
1.9 treitmay 155: fi
1.1 treitmay 156:
1.11 treitmay 157: .PHONY: help
158: help:
159: @echo "targets: all build xpi archive (default), includes"
160: @echo " running jslint and adjustment of update host"
161: @echo " clean remove .xpi, .jar, .xpt"
162: @echo " install copy $(PROJECT).xpi/.xml to download directory"
163: @echo ""
164: @echo "variables: HOST update host to change in install.rdf; allowed values:"
1.25 ! treitmay 165: @echo " de: erweiterungen.de"
! 166: @echo " mozdev: mozdev.org"
! 167: @echo " local: localhost"
! 168: @echo " <none>: devbase.at"
1.11 treitmay 169:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>