diff options
author | Unia <jthidskes@live.nl> | 2013-04-07 00:03:04 +0200 |
---|---|---|
committer | Unia <jthidskes@live.nl> | 2013-04-07 00:03:04 +0200 |
commit | 56d315b91b431b8a4da1030d4f2e498e0600e299 (patch) | |
tree | b9abe1789a31a9639108b9200ee787de21dad98a /Makefile | |
parent | 2ae3c219a0354f60709380281fcbf80cdb392d7a (diff) |
improved makefile, readme. small code cleanups
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) |