-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (25 loc) · 693 Bytes
/
Copy pathMakefile
File metadata and controls
34 lines (25 loc) · 693 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
CC = gcc
CFLAG = -fcommon -D _GNU_SOURCE #-fsanitize=address -g3
RM = rm -rf
NAME = MINILINUX
SRC_DIR = source
OBJ_DIR = object
INCS = include
SRCS = directory.c instruction.c main.c touch.c \
stack.c time.c user.c cat.c cd.c thread.c \
chmod.c chown.c system.c find.c mkdir.c directorytree.c \
rm.c pwd.c ls.c cp.c permission.c grep.c userlist.c
OBJS = $(addprefix $(OBJ_DIR)/, $(SRCS:.c=.o))
all: $(NAME)
$(NAME): $(OBJS)
$(CC) $(CFLAG) -o $@ $(OBJS) -I$(INCS) -lpthread
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR)
@mkdir -p $(OBJ_DIR)
$(CC) $(CFLAG) -c $< -o $@ -I$(INCS)
clean:
$(RM) $(OBJS)
fclean: clean
$(RM) $(NAME)
re: fclean
make all
.PHONY: all clean fclean re