-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (28 loc) · 781 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
40
41
# Makefile to build a program with gcc and install config and binary files
# Compiler
CC := gcc
# Compiler flags
CFLAGS := -Wall -Wextra
# Program source files
SRCS := backlight_manager.c
# Program executable name
TARGET := backlight_manager
# XDG_CONFIG_HOME directory
XDG_CONFIG_HOME := $(HOME)/.config
# Directory for the program config
CONFIG_DIR := $(XDG_CONFIG_HOME)/backlight_manager
# Installation directories
BIN_DIR := /usr/bin
all: $(TARGET)
$(TARGET): $(SRCS)
$(CC) $(CFLAGS) $(SRCS) -o $(TARGET)
install: all
mkdir -p $(CONFIG_DIR)
cp backlight_manager.conf $(CONFIG_DIR)/backlight_manager.conf
cp $(TARGET) $(BIN_DIR)/$(TARGET)
uninstall:
rm -f $(BIN_DIR)/$(TARGET)
clean:
rm -rf $(CONFIG_DIR)
rm -f $(TARGET)
.PHONY: all install uninstall clean