Simplify build system
This commit is contained in:
30
gtk/Makefile
30
gtk/Makefile
@@ -1,22 +1,26 @@
|
||||
CFLAGS = -Wall -O2 -I.. `pkg-config --cflags gtk+-3.0`
|
||||
LDFLAGS = `pkg-config --libs gtk+-3.0`
|
||||
DSTDIR ?= $(shell find /usr/lib* -type d -path "*/gtk-3.0/*/immodules" 2>/dev/null | head -1)
|
||||
PROG = im-strans.so
|
||||
CFLAGS = -Wall -O2 -I.. $(shell pkg-config --cflags gtk+-3.0)
|
||||
LDFLAGS = $(shell pkg-config --libs gtk+-3.0)
|
||||
DSTDIR ?= $(shell find /usr/lib* -type d \
|
||||
-path "*/gtk-3.0/*/immodules" 2>/dev/null | head -1)
|
||||
|
||||
im-strans.so: main.c ../ipc.c ../ipc.h
|
||||
all: $(PROG)
|
||||
|
||||
$(PROG): main.c ../ipc.c ../ipc.h
|
||||
$(CC) -shared -fPIC $(CFLAGS) -o $@ main.c ../ipc.c $(LDFLAGS)
|
||||
|
||||
docker: main.c Dockerfile
|
||||
docker build -t strans-gtk .
|
||||
docker run --rm -v $(CURDIR)/..:/src -w /src/gtk strans-gtk make im-strans.so
|
||||
|
||||
install:
|
||||
mkdir -p $(DSTDIR)
|
||||
cp im-strans.so $(DSTDIR)/
|
||||
install: $(PROG)
|
||||
test -n "$(DSTDIR)"
|
||||
mkdir -p "$(DSTDIR)"
|
||||
cp $(PROG) "$(DSTDIR)/"
|
||||
gtk-query-immodules-3.0 --update-cache
|
||||
|
||||
uninstall:
|
||||
rm -f $(DSTDIR)/im-strans.so
|
||||
test -n "$(DSTDIR)"
|
||||
rm -f "$(DSTDIR)/$(PROG)"
|
||||
gtk-query-immodules-3.0 --update-cache
|
||||
|
||||
clean:
|
||||
rm -f im-strans.so
|
||||
rm -f $(PROG)
|
||||
|
||||
.PHONY: all install uninstall clean
|
||||
|
||||
Reference in New Issue
Block a user