blob: 180a311cd193151b40c5a0dada451c154dfc0618 (
plain)
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
|
# Define variables
CC = gcc
CFLAGS = -std=c99 -Wall $(shell pkg-config --cflags libnotify)
LDFLAGS = $(shell pkg-config --libs libnotify)
LIBS = -lnotify
TARGET = lowbat
SRCS = lowbat.c
OBJS = $(SRCS:.c=.o)
# Default target
all: $(TARGET)
# Build target
$(TARGET): $(OBJS)
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS) $(LIBS)
# Compile source files
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
# Clean up build files
clean:
rm -f $(TARGET) $(OBJS)
# Phony targets
.PHONY: all clean
|