swot

neuSWc screenshOT tool
git clone https://git.daat.foo/swot.git
Log | Files | Refs | README | LICENSE

Makefile (1022B)


      1 .POSIX:
      2 
      3 CC = cc
      4 PREFIX = /usr/local
      5 PKG_CONFIG = pkg-config
      6 WAYLAND_SCANNER = wayland-scanner
      7 PACKAGES = wayland-client xkbcommon spng libjpeg
      8 
      9 HEADERS = swc_snap.h layer.h
     10 SOURCES = swc_snap.c layer.c
     11 
     12 swot: swot.c util.c util.h $(HEADERS) $(SOURCES)
     13 	$(CC) -std=c99 $(CPPFLAGS) $(CFLAGS) -o $@ swot.c util.c $(SOURCES) \
     14 		$(LDFLAGS) `$(PKG_CONFIG) --cflags --libs $(PACKAGES)` $(LDLIBS)
     15 
     16 swc_snap.h swc_snap.c: protocol/swc_snap.xml
     17 layer.h layer.c: protocol/layer.xml
     18 
     19 $(HEADERS):
     20 	$(WAYLAND_SCANNER) client-header protocol/$(@:.h=.xml) $@
     21 
     22 $(SOURCES):
     23 	$(WAYLAND_SCANNER) private-code protocol/$(@:.c=.xml) $@
     24 
     25 install: swot
     26 	mkdir -p "$(DESTDIR)$(PREFIX)/bin"
     27 	cp swot "$(DESTDIR)$(PREFIX)/bin/swot"
     28 	chmod 755 "$(DESTDIR)$(PREFIX)/bin/swot"
     29 	mkdir -p "$(DESTDIR)$(PREFIX)/share/licenses/swot/protocol"
     30 	cp LICENSE "$(DESTDIR)$(PREFIX)/share/licenses/swot/"
     31 	cp protocol/LICENSE protocol/layer.xml "$(DESTDIR)$(PREFIX)/share/licenses/swot/protocol/"
     32 
     33 clean:
     34 	rm -f swot $(HEADERS) $(SOURCES)
     35 
     36 .PHONY: install clean