diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 33 |
1 files changed, 30 insertions, 3 deletions
@@ -1,5 +1,32 @@ -gstopwatch: - gcc gstopwatch.c `pkg-config --cflags --libs gtk+-3.0` -o gstopwatch +PROG = gstopwatch + +CC = gcc +LIBS = `pkg-config --cflags --libs gtk+-3.0` +CFLAGS = -std=c99 -Wall -Wextra -Wno-deprecated-declarations + +PREFIX ?= /usr/local +BINPREFIX = $(PREFIX)/bin + +all: CFLAGS += -Os +all: LDFLAGS += -s +all: $(PROG) + +debug: CFLAGS += -O0 -g -pedantic +debug: all + +$(PROG): $(PROG).c + gcc $(PROG).c -o $(PROG) $(CFLAGS) $(LIBS) + +install: + mkdir -p $(DESTDIR)/$(BINPREFIX) + mkdir -p $(DESTDIR)/usr/share/applications/ + + install -m 0755 $(PROG) $(DESTDIR)/$(BINPREFIX)/ + install -m 0644 data/$(PROG).desktop $(DESTDIR)/usr/share/applications/ + +uninstall: + rm -f $(BINPREFIX)/$(PROG) + rm -f /usr/share/applications/$(PROG).desktop clean: - rm -f gstopwatch + rm -f $(PROG) |