-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
35 lines (25 loc) · 793 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
CC = gcc
CFLAGS = -Wall -Wextra -pedantic -D_GNU_SOURCE -std=gnu99
LDFLAGS = -lncurses -lm
SRC = conway-screensaver.c
OBJ = $(SRC:.c=.o)
EXEC = conway-screensaver
all: $(EXEC)
$(EXEC): $(OBJ)
$(CC) $(OBJ) -o $(EXEC) $(LDFLAGS)
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
install: all
install -Dm755 $(EXEC) /usr/bin/$(EXEC)
install -Dm644 game_of_life.conf /usr/share/doc/conway-screensaver/game_of_life.conf
install-config:
mkdir -p ~/.config/conway-screensaver
cp /usr/share/doc/conway-screensaver/game_of_life.conf ~/.config/conway-screensaver/
uninstall:
rm -f /usr/bin/$(EXEC)
rm -f /usr/share/doc/conway-screensaver/game_of_life.conf
uninstall-config:
rm -f ~/.config/conway-screensaver/game_of_life.conf
clean:
rm -f $(OBJ) $(EXEC)
.PHONY: all clean install install-config