Skip to content

Commit

Permalink
make: add deploy target
Browse files Browse the repository at this point in the history
for deb,rpm,pkgin(bsd) and osxpkg (darwin).
no windows installer yet
  • Loading branch information
Reini Urban committed Jan 14, 2016
1 parent f7c451e commit cc4cc14
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# posix (linux, bsd, osx, solaris) + mingw with gcc/clang only
.SUFFIXES: .y .c .i .o .opic .textile .html
.PHONY: all default bins libs pn static usage config clean doc rebuild check test bench tarball dist \
examples release install grammar doxygen website testable
examples release deploy install grammar doxygen website testable
.NOTPARALLEL: test

SRC = core/asm.c core/ast.c core/compile.c core/contrib.c core/gc.c core/internal.c core/lick.c core/mt19937ar.c core/number.c core/objmodel.c core/primitive.c core/string.c core/syntax.c core/table.c core/vm.c
Expand Down Expand Up @@ -423,6 +423,9 @@ tarball:
release: dist
+$(MAKE) -f dist.mak $@ PREFIX="${PREFIX}"

deploy: release
+$(MAKE) -f dist.mak $@ PREFIX="${PREFIX}"

%.html: %.textile
@${ECHO} DOC $@
@${ECHO} "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">" > $@
Expand Down
28 changes: 27 additions & 1 deletion dist.mak
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ PLATFORM = $(shell ./tools/config.sh "${CC}" target)
RELEASE ?= ${VERSION}.${REVISION}
PKG = potion-${RELEASE}
PKGBIN = ${PKG}-${PLATFORM}
PKG_DESC = "potion language"
ifeq (${WIN32},1)
BINDIST = pkg/${PKGBIN}.zip
else
Expand All @@ -26,6 +27,31 @@ dist: bin-dist src-dist

release: dist

# sudo gem install fpm
# pkgin is for BSD, with pkg_create
# TODO: need a simple one-line windows cmd-line installer from the zip

define EXPAND_DEPLOY
ifneq ($$(WIN32),1)
deploy: release
rm -rf dist
mkdir dist
tar xfz pkg/${PKGBIN}.tar.gz -C dist/
tar xfz pkg/${PKGBIN}-devel.tar.gz -C dist/
ifeq ($$(DLL),.so)
fpm -s dir -t deb -C dist -p pkg --name potion --version $(VERSION) --description $(PKG_DESC)
fpm -s dir -t rpm -C dist -p pkg --name potion --version $(VERSION) --description $(PKG_DESC)
-fpm -s dir -t pkgin -C dist -p pkg --name potion --version $(VERSION) --description $(PKG_DESC)
endif
ifeq ($$(DLL),.dylib)
fpm -s dir -t osxpkg -C dist -p pkg --name potion --version $(VERSION) --description $(PKG_DESC)
endif
rm -rf dist
endif
endef

$(eval $(call EXPAND_DEPLOY))

install: bin-dist
${SUDO} tar xfz pkg/${PKGBIN}.tar.gz -C $(PREFIX)/

Expand Down Expand Up @@ -127,4 +153,4 @@ GTAGS: ${SRC} core/*.h
mv ${PKG}/ref doc/
rm -rf ${PKG}

.PHONY: dist release install tarball src-dist bin-dist
.PHONY: dist release deploy install tarball src-dist bin-dist

0 comments on commit cc4cc14

Please sign in to comment.