-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (42 loc) · 1.54 KB
/
Makefile
File metadata and controls
58 lines (42 loc) · 1.54 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# You can use clang if you prefer
CC = gcc
# Feel free to add other C flags
CFLAGS += -c -std=gnu99 -Wall -Werror -Wextra -O2
# By default, we colorize the output, but this might be ugly in log files, so feel free to remove the following line.
CFLAGS += -D_COLOR
# You may want to add something here
LDFLAGS += -lz
# Adapt these as you want to fit with your project
SENDER_SOURCES = $(wildcard src/sender.c src/log.c)
RECEIVER_SOURCES = $(wildcard src/receiver.c src/log.c)
SENDER_OBJECTS = $(SENDER_SOURCES:.c=.o)
RECEIVER_OBJECTS = $(RECEIVER_SOURCES:.c=.o)
SENDER = sender
RECEIVER = receiver
all: $(SENDER) $(RECEIVER)
$(SENDER): $(SENDER_OBJECTS)
$(CC) $(SENDER_OBJECTS) -o $@ $(LDFLAGS)
$(RECEIVER): $(RECEIVER_OBJECTS)
$(CC) $(RECEIVER_OBJECTS) -o $@ $(LDFLAGS)
%.o: %.c
$(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
.PHONY: clean mrproper
clean:
rm -f $(SENDER_OBJECTS) $(RECEIVER_OBJECTS)
mrproper:
rm -f $(SENDER) $(RECEIVER)
# It is likely that you will need to update this
tests: all
./tests/run_tests.sh
# By default, logs are disabled. But you can enable them with the debug target.
debug: CFLAGS += -D_DEBUG
debug: clean all
# Place the zip in the parent repository of the project
ZIP_NAME="../projet1_nom1_nom2.zip"
# A zip target, to help you have a proper zip file. You probably need to adapt this code.
zip:
# Generate the log file stat now. Try to keep the repository clean.
git log --stat > gitlog.stat
zip -r $(ZIP_NAME) Makefile src tests rapport.pdf gitlog.stat
# We remove it now, but you can leave it if you want.
rm gitlog.stat