-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (34 loc) · 912 Bytes
/
Makefile
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
33
34
35
36
37
38
39
VERSION := $(shell cat VERSION)
CC = cc
SOURCEVIEW =
SOURCEVIEWARG =
ifeq ($(WITHSOURCEVIEW),1)
SOURCEVIEW = gtksourceview-4
SOURCEVIEWARG = -DWITHSOURCEVIEW
endif
CFLAGS = `pkg-config --cflags gtk+-3.0 $(SOURCEVIEW)` -Dpver=\"$(VERSION)\" $(SOURCEVIEWARG)
LIBS = `pkg-config --libs gtk+-3.0 $(SOURCEVIEW)`
SRC = sgnotes.c
OBJ = $(SRC:.c=.o)
EXE = sgnotes
PREFIX = /usr
BIN_DIR = $(PREFIX)/bin
APP_DIR = $(PREFIX)/share/applications
ICON_DIR = $(PREFIX)/share/icons/hicolor/64x64/apps/
all: $(EXE)
sgnotes: sgnotes.o
$(CC) $(CFLAGS) -o $@ $< $(LIBS)
debug:
$(CC) $(CFLAGS) -g $(SRC) -o debug $(LIBS)
test:
./$(EXE)
install:
install -Dm755 $(EXE) $(BIN_DIR)/$(EXE)
install -Dm644 $(EXE).desktop $(APP_DIR)/$(EXE).desktop
install -Dm644 icons/$(EXE).svg $(ICON_DIR)/$(EXE).svg
uninstall:
rm $(BIN_DIR)/$(EXE)
rm $(APP_DIR)/$(EXE).desktop
rm $(ICON_DIR)/$(EXE).svg
clean:
rm -f $(OBJ) $(EXE) debug