]> git.proxmox.com Git - spiceterm.git/blobdiff - Makefile
rework buildsystem, move to own src folder
[spiceterm.git] / Makefile
index b6f20351732293527717d3e8e43d14bcc9737af6..f1284d0a92fcefd66945004d2ae6654ee422c83a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,35 +1,33 @@
+include /usr/share/dpkg/pkg-info.mk
+include /usr/share/dpkg/architecture.mk
 
-PROGRAMS=spiceterm
+PACKAGE=spiceterm
 
-HEADERS=translations.h event_loop.h glyphs.h spiceterm.h keysyms.h
-SOURCES=screen.c event_loop.c input.c spiceterm.c auth-pve.c
+GITVERSION:=$(shell cat .git/refs/heads/master)
+BUILDDIR ?= ${PACKAGE}-${DEB_VERSION_UPSTREAM}
 
-#export G_MESSAGES_DEBUG=all 
-#export SPICE_DEBUG=1
+export VERSION=$(DEB_VERSION_UPSTREAM)
 
-all: ${PROGRAMS}
+DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_${DEB_BUILD_ARCH}.deb
 
-spiceterm: ${SOURCES} ${HEADERS} spiceterm.c 
-       gcc -Werror -Wall -Wtype-limits ${SOURCES} -g -O2 -o $@ -lutil $(shell pkg-config) $(shell pkg-config --cflags --libs gthread-2.0,spice-protocol,spice-server)
+.PHONY: deb
+deb: ${DEB}
+${DEB}:
+       rm -rf $(BUILDDIR)
+       rsync -a src/ debian $(BUILDDIR)
+       echo "git clone git://git.proxmox.com/git/spiceterm.git\\ngit checkout ${GITVERSION}" > $(BUILDDIR)/debian/SOURCE
+       cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
+       lintian ${DEB}
 
-genfont: genfont.c
-       gcc -g -O2 -o $@ genfont.c -Wall -D_GNU_SOURCE -lz
+.PHONY: dinstall
+dinstall: ${DEB}
+       dpkg -i ${DEB}
 
-keysyms.h: genkeysym.pl
-       ./genkeysym.pl >$@
+.PHONY: upload
+upload: ${DEB}
+       tar cf - ${DEB} | ssh repoman@repo.proxmox.com -- upload --product pve --dist stretch --arch ${ARCH}
 
-.PHONY: glyphs
-glyphs: genfont
-       ./genfont > glyphs.h
-
-.PHONY: test
-test: spiceterm
-       ./spiceterm --noauth --keymap de & remote-viewer spice://localhost?tls-port=5900
-       #G_MESSAGES_DEBUG=all SPICE_DEBUG=1 SPICE_TICKET=test ./spiceterm & G_MESSAGES_DEBUG=all SPICE_DEBUG=1 remote-viewer --debug 'spice://localhost?tls-port=5900' --spice-ca-file /etc/pve/pve-root-ca.pem --spice-secure-channels=all
-
-.PHONY: distclean
+.PHONY: distclean clean
 distclean: clean
-
-.PHONY: clean
 clean:
-       rm -rf *~ ${PROGRAMS}
\ No newline at end of file
+       rm -rf *~ $(BUILDDIR) *.deb *.changes genfont *.buildinfo