-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (23 loc) · 722 Bytes
/
Makefile
File metadata and controls
33 lines (23 loc) · 722 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
CC = gcc
CFLAGS = -Wall -pthread -Iinclude
SRC_DIR = src
BIN_DIR = bin
SRCS = $(SRC_DIR)/manager.c $(SRC_DIR)/worker1.c $(SRC_DIR)/worker2.c $(SRC_DIR)/worker3.c
OBJS = $(SRCS:.c=.o)
TARGET = manager
WORKERS = worker1 worker2 worker3
all: $(TARGET) $(WORKERS)
$(TARGET): $(SRC_DIR)/manager.o
$(CC) $(CFLAGS) -o $(TARGET) $(SRC_DIR)/manager.o
worker1: $(SRC_DIR)/worker1.o
$(CC) $(CFLAGS) -o worker1 $(SRC_DIR)/worker1.o
worker2: $(SRC_DIR)/worker2.o
$(CC) $(CFLAGS) -o worker2 $(SRC_DIR)/worker2.o
worker3: $(SRC_DIR)/worker3.o
$(CC) $(CFLAGS) -o worker3 $(SRC_DIR)/worker3.o
$(SRC_DIR)/%.o: $(SRC_DIR)/%.c
$(CC) $(CFLAGS) -c $< -o $@
run: all
./$(TARGET)
clean:
rm -f $(SRC_DIR)/*.o $(TARGET) $(WORKERS)