Fixing minor bugs
[quicknote] / Makefile
index 86a6221..3642f91 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 PROJECT_NAME=quicknote
 PROJECT_NAME=quicknote
-PROJECT_VERSION=0.7.7
+PROJECT_VERSION=0.7.8
 SOURCE_PATH=src
 SOURCE=$(shell find $(SOURCE_PATH) -iname "*.py")
 LOCALE_PATH=locale
 SOURCE_PATH=src
 SOURCE=$(shell find $(SOURCE_PATH) -iname "*.py")
 LOCALE_PATH=locale
@@ -10,33 +10,37 @@ BUILD_PATH=./builddeb/
 
 TEXT_DOMAIN=$(PROJECT_NAME)
 POTFILES=$(wildcard src/quicknoteclasses/*.py)
 
 TEXT_DOMAIN=$(PROJECT_NAME)
 POTFILES=$(wildcard src/quicknoteclasses/*.py)
+TAG_FILE=~/.ctags/$(PROJECT_NAME).tags
+TODO_FILE=./TODO
 
 
+DEBUGGER=winpdb
 UNIT_TEST=nosetests --with-doctest -w .
 SYNTAX_TEST=support/test_syntax.py
 UNIT_TEST=nosetests --with-doctest -w .
 SYNTAX_TEST=support/test_syntax.py
+STYLE_TEST=../../Python/tools/pep8.py --ignore=W191,E501
 LINT_RC=./support/pylint.rc
 LINT=pylint --rcfile=$(LINT_RC)
 PROFILE_GEN=python -m cProfile -o .profile
 PROFILE_VIEW=python -m pstats .profile
 LINT_RC=./support/pylint.rc
 LINT=pylint --rcfile=$(LINT_RC)
 PROFILE_GEN=python -m cProfile -o .profile
 PROFILE_VIEW=python -m pstats .profile
+TODO_FINDER=support/todo.py
+CTAGS=ctags-exuberant
 
 
-.PHONY: all run profile test lint clean distclean install update_po build_mo
+.PHONY: all run profile debug test lint tags todo clean distclean install update_po build_mo
 
 
-all: build_mo
-       python2.5 setup.py build  
+all: test
 
 
-run:
+run: $(OBJ)
        $(PROGRAM)
 
        $(PROGRAM)
 
-profile:
+profile: $(OBJ)
        $(PROFILE_GEN) $(PROGRAM)
        $(PROFILE_VIEW)
 
        $(PROFILE_GEN) $(PROGRAM)
        $(PROFILE_VIEW)
 
+debug: $(OBJ)
+       $(DEBUGGER) $(PROGRAM)
+
 test: $(OBJ)
        $(UNIT_TEST)
 
 test: $(OBJ)
        $(UNIT_TEST)
 
-package: clean $(OBJ) all
-       dpkg-buildpackage -rfakeroot 
-       dpkg -i ../$(PROJECT_NAME)_$(PROJECT_VERSION)_all.deb
-
 update_po: po/templates.pot
        @for lang in $(basename $(notdir $(wildcard po/*.po))); do \
                msgmerge -U --strict --no-wrap po/$$lang.po po/templates.pot; \
 update_po: po/templates.pot
        @for lang in $(basename $(notdir $(wildcard po/*.po))); do \
                msgmerge -U --strict --no-wrap po/$$lang.po po/templates.pot; \
@@ -51,41 +55,69 @@ build_mo:
                msgfmt --statistics -c -o locale/$$lang/LC_MESSAGES/$(TEXT_DOMAIN).mo po/$$lang.po; \
        done
 
                msgfmt --statistics -c -o locale/$$lang/LC_MESSAGES/$(TEXT_DOMAIN).mo po/$$lang.po; \
        done
 
-build: $(OBJ) build_mo
+package: $(OBJ) build_mo
        rm -Rf $(BUILD_PATH)
        rm -Rf $(BUILD_PATH)
-       mkdir $(BUILD_PATH)
-       cp $(PROGRAM)  $(BUILD_PATH)
-       cp src/constants.py $(BUILD_PATH)
-       $(foreach file, $(DATA), cp $(file) $(BUILD_PATH)/$(subst /,-,$(file)) ; )
-       $(foreach file, $(SOURCE), cp $(file) $(BUILD_PATH)/$(subst /,-,$(file)) ; )
-       $(foreach file, $(OBJ), cp $(file) $(BUILD_PATH)/$(subst /,-,$(file)) ; )
-       $(foreach file, $(LOCALE_FILES), cp $(file) $(BUILD_PATH)/$(subst /,-,$(file)) ; )
-       cp data/$(PROJECT_NAME).desktop $(BUILD_PATH)
-       cp data/$(PROJECT_NAME).service $(BUILD_PATH)
-       cp data/low/$(PROJECT_NAME).png $(BUILD_PATH)/26x26-$(PROJECT_NAME).png
-       cp data/40/$(PROJECT_NAME).png $(BUILD_PATH)/40x40-$(PROJECT_NAME).png
-       cp data/48/$(PROJECT_NAME).png $(BUILD_PATH)/48x48-$(PROJECT_NAME).png
-       cp data/scale/$(PROJECT_NAME).png $(BUILD_PATH)/scale-$(PROJECT_NAME).png
-       cp support/builddeb.py $(BUILD_PATH)
-       cp support/fake_py2deb.py $(BUILD_PATH)
+
+       mkdir -p $(BUILD_PATH)/generic
+       cp $(SOURCE_PATH)/constants.py $(BUILD_PATH)/generic
+       cp $(PROGRAM)  $(BUILD_PATH)/generic
+       $(foreach file, $(DATA), cp $(file) $(BUILD_PATH)/generic/$(subst /,-,$(file)) ; )
+       $(foreach file, $(SOURCE), cp $(file) $(BUILD_PATH)/generic/$(subst /,-,$(file)) ; )
+       #$(foreach file, $(OBJ), cp $(file) $(BUILD_PATH)/generic/$(subst /,-,$(file)) ; )
+       $(foreach file, $(LOCALE_FILES), cp $(file) $(BUILD_PATH)/generic/$(subst /,-,$(file)) ; )
+       cp data/$(PROJECT_NAME).desktop $(BUILD_PATH)/generic
+       cp data/$(PROJECT_NAME).service $(BUILD_PATH)/generic
+       cp data/low/$(PROJECT_NAME).png $(BUILD_PATH)/generic/26x26-$(PROJECT_NAME).png
+       cp data/40/$(PROJECT_NAME).png $(BUILD_PATH)/generic/40x40-$(PROJECT_NAME).png
+       cp data/48/$(PROJECT_NAME).png $(BUILD_PATH)/generic/48x48-$(PROJECT_NAME).png
+       cp data/scale/$(PROJECT_NAME).png $(BUILD_PATH)/generic/scale-$(PROJECT_NAME).png
+       cp support/builddeb.py $(BUILD_PATH)/generic
+       cp support/py2deb.py $(BUILD_PATH)/generic
+       cp support/fake_py2deb.py $(BUILD_PATH)/generic
+
+       mkdir -p $(BUILD_PATH)/diablo
+       cp -R $(BUILD_PATH)/generic/* $(BUILD_PATH)/diablo
+       cd $(BUILD_PATH)/diablo ; python builddeb.py diablo
+       mkdir -p $(BUILD_PATH)/fremantle
+       cp -R $(BUILD_PATH)/generic/* $(BUILD_PATH)/fremantle
+       cd $(BUILD_PATH)/fremantle ; python builddeb.py fremantle
+       mkdir -p $(BUILD_PATH)/debian
+       cp -R $(BUILD_PATH)/generic/* $(BUILD_PATH)/debian
+       cd $(BUILD_PATH)/debian ; python builddeb.py debian
+
+upload:
+       dput fremantle-extras-builder $(BUILD_PATH)/fremantle/$(PROJECT_NAME)*.changes
+       dput diablo-extras-builder $(BUILD_PATH)/diablo/$(PROJECT_NAME)*.changes
+       cp $(BUILD_PATH)/debian/*.deb ../www/$(PROJECT_NAME).deb
 
 lint: $(OBJ)
        $(foreach file, $(SOURCE), $(LINT) $(file) ; )
 
 
 lint: $(OBJ)
        $(foreach file, $(SOURCE), $(LINT) $(file) ; )
 
-clean: 
+tags: $(TAG_FILE) 
+
+todo: $(TODO_FILE)
+
+clean:
        rm -rf ./locale
        rm -rf ./locale
-       rm -rf $(OBJ)
+       rm -Rf $(OBJ)
        rm -Rf $(BUILD_PATH)
        rm -Rf $(BUILD_PATH)
-       python2.5 setup.py clean --all
+       rm -Rf $(TODO_FILE)
 
 
-distclean: clean
+distclean:
+       rm -Rf $(OBJ)
+       rm -Rf $(BUILD_PATH)
+       rm -Rf $(TAG_FILE)
        find $(SOURCE_PATH) -name "*.*~" | xargs rm -f
        find $(SOURCE_PATH) -name "*.swp" | xargs rm -f
        find $(SOURCE_PATH) -name "*.bak" | xargs rm -f
        find $(SOURCE_PATH) -name ".*.swp" | xargs rm -f
 
        find $(SOURCE_PATH) -name "*.*~" | xargs rm -f
        find $(SOURCE_PATH) -name "*.swp" | xargs rm -f
        find $(SOURCE_PATH) -name "*.bak" | xargs rm -f
        find $(SOURCE_PATH) -name ".*.swp" | xargs rm -f
 
-install: build_mo
-       python2.5 setup.py install --root $(DESTDIR) 
+$(TAG_FILE): $(OBJ)
+       mkdir -p $(dir $(TAG_FILE))
+       $(CTAGS) -o $(TAG_FILE) $(SOURCE)
+
+$(TODO_FILE): $(SOURCE)
+       @- $(TODO_FINDER) $(SOURCE) > $(TODO_FILE)
 
 %.pyc: %.py
        $(SYNTAX_TEST) $<
 
 %.pyc: %.py
        $(SYNTAX_TEST) $<