aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 0033ed9b35a7dca9b2ffe6d17d7c5e23e9050eeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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 $(PROG)