Skip to content

Commit 4f01819

Browse files
committed
Update Makefile for optimizations and installation
1 parent 9dfa6c1 commit 4f01819

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

Makefile

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,38 @@
1+
INC_FLAGS := `pkg-config --cflags gtksourceview-4`
2+
3+
ifeq ($(RELEASE),yes)
4+
CFLAGS := -c -O3
5+
else
6+
CFLAGS := -c -g
7+
endif
8+
9+
ifeq ($(PREFIX),)
10+
PREFIX := /usr
11+
endif
12+
113
notes: commands.o menu.o main.o
2-
cc main.o -g `pkg-config --libs gtksourceview-4` commands.o menu.o -o notes
14+
gcc main.o `pkg-config --libs gtksourceview-4` commands.o menu.o -o notes
315
main.o: main.c
4-
cc main.c -c `pkg-config --cflags gtksourceview-4`
16+
cc main.c $(CFLAGS) $(INC_FLAGS)
517
commands.o: commands.c
6-
cc commands.c -c `pkg-config --cflags gtksourceview-4` -Wno-deprecated-declarations
18+
cc commands.c $(CFLAGS) $(INC_FLAGS) -Wno-deprecated-declarations
719
menu.o: menu.c
8-
cc menu.c -c `pkg-config --cflags gtksourceview-4`
20+
cc menu.c $(CFLAGS) $(INC_FLAGS)
921

1022
clean:
1123
rm *.o
1224

13-
appimage: commands.o menu.o main.o
25+
install: notes
26+
strip notes
27+
install -d $(PREFIX)/bin/
28+
install notes $(PREFIX)/bin/
29+
install -d $(PREFIX)/share/pixmaps/
30+
install assets/notes.png $(PREFIX)/share/pixmaps/
31+
install -d $(PREFIX)/share/applications/
32+
install release/notes.desktop $(PREFIX)/share/applications/
33+
34+
appimage: notes
1435
cc -O3 release/AppRun.c -o release/AppRun
15-
cc -O3 main.o `pkg-config --libs gtksourceview-4` commands.o menu.o -o notes
1636
strip release/AppRun
1737
strip notes
1838
mkdir -p release/usr/lib

release/.DirIcon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Notes.png
1+
notes.png

0 commit comments

Comments
 (0)