forked from TuxForge/archie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (27 loc) · 784 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
CC = gcc
CFLAGS = -Wall -Wextra -O2 -g
LDFLAGS = -lreadline -lncurses
BUILD_DIR = build
SRC = main.c commands.c error_handling.c utils.c package_manager.c display.c autocomplete.c
OBJ = $(SRC:%.c=$(BUILD_DIR)/%.o)
TARGET = $(BUILD_DIR)/archium
.PHONY: all clean install uninstall
all: $(BUILD_DIR) $(TARGET)
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
$(BUILD_DIR)/%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
$(TARGET): $(OBJ)
$(CC) $(OBJ) -o $@ $(LDFLAGS)
@echo "Build complete! Binary is at: $(TARGET)"
install: $(TARGET)
install -D $(TARGET) $(DESTDIR)/usr/local/bin/archium
uninstall:
rm -f $(DESTDIR)/usr/local/bin/archium
clean:
rm -rf $(BUILD_DIR)
# Debug target to show variables
debug:
@echo "Source files: $(SRC)"
@echo "Object files: $(OBJ)"
@echo "Target: $(TARGET)"