-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
26 lines (19 loc) · 727 Bytes
/
Makefile
File metadata and controls
26 lines (19 loc) · 727 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
CC = gcc
CFLAGS = -Wall -Wextra
OBJ_DIR = build
SRC_DIR = src
INC_DIR = include
BIN_DIR = bin
LIB_DIR = lib
TARGET = test
INC_FLAGS = -I./$(INC_DIR)
.PHONY : clean all
all : $(BIN_DIR)/$(TARGET)
$(BIN_DIR)/$(TARGET) : $(OBJ_DIR)/test.o $(OBJ_DIR)/textUtils.o
@$(CC) $(CFLAGS) $(INC_FLAGS) $(OBJ_DIR)/test.o $(OBJ_DIR)/textUtils.o -o $(BIN_DIR)/$(TARGET)
$(OBJ_DIR)/test.o : $(SRC_DIR)/test.c $(INC_DIR)/textUtils.h
@$(CC) $(CFLAGS) $(INC_FLAGS) -c $(SRC_DIR)/test.c -o $(OBJ_DIR)/test.o
$(OBJ_DIR)/textUtils.o : $(SRC_DIR)/textUtils.c $(INC_DIR)/textUtils.h
@$(CC) $(CFLAGS) $(INC_FLAGS) -c $(SRC_DIR)/textUtils.c -o $(OBJ_DIR)/textUtils.o
clean:
rm -rf $(BIN_DIR)/$(TARGET) $(OBJ_DIR)/*.o $(LIB_DIR)/*.a export