comictagger/Makefile

60 lines
1.6 KiB
Makefile
Raw Normal View History

2019-09-28 05:59:36 -07:00
VERSION_STR := $(shell python setup.py --version)
2018-01-17 13:35:10 -08:00
ifeq ($(OS),Windows_NT)
2019-09-24 15:36:08 -07:00
OS_VERSION=win-$(PROCESSOR_ARCHITECTURE)
2018-01-17 13:35:10 -08:00
APP_NAME=comictagger.exe
2019-09-24 15:36:08 -07:00
FINAL_NAME=ComicTagger-$(VERSION_STR)-$(OS_VERSION).exe
2018-01-17 13:35:10 -08:00
else ifeq ($(shell uname -s),Darwin)
2019-09-24 15:30:23 -07:00
OS_VERSION=osx-$(shell defaults read loginwindow SystemVersionStampAsString)-$(shell uname -m)
2018-01-17 13:35:10 -08:00
APP_NAME=ComicTagger.app
2019-09-24 15:30:23 -07:00
FINAL_NAME=ComicTagger-$(VERSION_STR)-$(OS_VERSION).app
2018-01-17 13:35:10 -08:00
else
APP_NAME=comictagger
FINAL_NAME=ComicTagger-$(VERSION_STR)
endif
.PHONY: all clean pydist upload unrar dist
all: clean dist
clean:
rm -rf *~ *.pyc *.pyo
rm -rf scripts/*.pyc
cd comictaggerlib; rm -f *~ *.pyc *.pyo
rm -rf dist MANIFEST
rm -rf *.deb
rm -rf logdict*.log
$(MAKE) -C mac clean
rm -rf build
$(MAKE) -C unrar clean
rm -f unrar/libunrar.so unrar/libunrar.a unrar/unrar
rm -f comictaggerlib/libunrar.so
rm -rf comictaggerlib/ui/__pycache__
2019-09-28 05:59:36 -07:00
rm comitaggerlib/ctversion.py
pydist:
make clean
mkdir -p piprelease
rm -f comictagger-$(VERSION_STR).zip
python setup.py sdist --formats=zip #,gztar
mv dist/comictagger-$(VERSION_STR).zip piprelease
rm -rf comictagger.egg-info dist
upload:
python setup.py register
python setup.py sdist --formats=zip upload
unrar:
2018-01-17 13:35:10 -08:00
ifeq ($(OS),Windows_NT)
# statically compile mingw dependencies
# https://stackoverflow.com/questions/18138635/mingw-exe-requires-a-few-gcc-dlls-regardless-of-the-code
$(MAKE) -C unrar LDFLAGS='-Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive -pthread -static-libgcc -static-libstdc++' lib
else
$(MAKE) -C unrar lib
endif
dist: unrar
2019-09-28 05:59:36 -07:00
pip install .
2018-01-17 13:35:10 -08:00
pyinstaller -y comictagger.spec
2019-09-24 15:30:23 -07:00
cd dist && zip -r $(FINAL_NAME).zip $(APP_NAME)