-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (33 loc) · 926 Bytes
/
Makefile
File metadata and controls
44 lines (33 loc) · 926 Bytes
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
CXX = g++
CXXFLAGS = -Wall -Wextra -std=c++17
SRC_DIR = functions
BUILD_DIR = build
SRCS = main.cpp \
$(SRC_DIR)/ascii_show.cpp \
$(SRC_DIR)/get_cpu_info.cpp \
$(SRC_DIR)/get_gpu_info.cpp \
$(SRC_DIR)/get_kernel.cpp \
$(SRC_DIR)/get_memory_info.cpp \
$(SRC_DIR)/get_os_info.cpp \
$(SRC_DIR)/get_shell.cpp \
$(SRC_DIR)/get_up_time.cpp \
$(SRC_DIR)/get_user.cpp
OBJS = $(SRCS:.cpp=.o)
BUILD_OBJS = $(addprefix $(BUILD_DIR)/, $(notdir $(OBJS)))
TARGET = $(BUILD_DIR)/betterfetch
all: $(BUILD_DIR) $(TARGET)
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
$(TARGET): $(BUILD_OBJS)
$(CXX) $(CXXFLAGS) -o $@ $(BUILD_OBJS)
$(BUILD_DIR)/%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
clean:
rm -rf $(BUILD_DIR)
.PHONY: all clean
install: all
install -d $(DESTDIR)/usr/local/bin
install $(TARGET) $(DESTDIR)/usr/local/bin/betterfetch
.PHONY: all clean install