-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (42 loc) · 1.26 KB
/
Makefile
File metadata and controls
55 lines (42 loc) · 1.26 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
CC := clang
version := $(shell git describe --tags --exact-match)
ifneq ($(.SHELLSTATUS), 0)
version := unstable
endif
version_long := $(shell git describe --tags --dirty --long)
# use "=" for dynamic changes
package_name = year-progress-$(version)-linux-x86_64
CFLAGS += -std=c17
CFLAGS += -Wall -Wextra -Wvla -Wno-unused-parameter
CFLAGS += -O2
CFLAGS += -Iexternal/ArgParseX/include/
CFLAGS += -DAPP_VERSION_STRING="\"$(version)\""
CFLAGS += -DAPP_VERSION_DESCRIBE="\"$(version_long)\""
sources_file := $(wildcard source/*.c)
all: year-progress
dist: year-progress-deb year-progress-rpm year-progress-pacman
libargparsex.a:
cd external/ArgParseX/ && \
./configure.sh --enable-batch-alloc && \
mkdir -p build && \
make && \
cp build/libargparsex.a ../../
year-progress: $(sources_file) libargparsex.a
$(CC) $^ $(CFLAGS) \
-o year-progress
year-progress-deb: year-progress
fpm --output-type deb \
--version $(version) \
--package $(package_name).deb
year-progress-rpm: year-progress
fpm --output-type rpm \
--version $(version) \
--package $(package_name).rpm
year-progress-pacman: year-progress
fpm --output-type pacman \
--version $(version) \
--package $(package_name).pkg.tar.zst
clean:
-rm year-progress
-rm lib*.a
-rm *.deb *.rpm *.pkg.tar.zst