-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
41 lines (27 loc) · 765 Bytes
/
makefile
File metadata and controls
41 lines (27 loc) · 765 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
## Shell-Todo Main Makefile ## ~ eylon
#---# SETTINGS #---#
export ROOT_DIR := $(shell pwd)
export CONFIG_MK := auto/config.mk
include $(CONFIG_MK)
#---# COMPILE #---#
all: $(EXECUTABLE)
# Link
$(EXECUTABLE): $(OBJS)
@mkdir -p ${BIN_DIR}
gcc ${CFLAGS} -o $@ $^
# Compile
$(BIN_DIR)/%.o: $(SRC_DIR)/%.c
@mkdir -p $(shell dirname $@)
${CC} ${CFLAGS} -c -o $@ $<
#---# EXECUTE #---#
run: $(EXECUTABLE)
${EXECUTABLE} ${ARGS} ${shell cat auto/command-line-arguments}
#---# UTILS #---#
clean:
rm -rf ${BIN_DIR}
# add the program to the /usr/bin/ directory
add_to_path: $(EXECUTABLE)
sudo cp $< /usr/bin/${COMMAND_NAME}
sudo chmod +x /usr/bin/${COMMAND_NAME}
@echo "> Program added to path, use "td" to call it."
.PHONY: all run clean add_to_path