summaryrefslogtreecommitdiff
path: root/Makefile
blob: 518a16f97dad349607596bd38f6f1a0f9f2b7068 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
CC = gcc
CFLAGS = -Wall -Wextra -O2 -g -std=c11 -fwrapv -pthread
LDFLAGS = -pthread

TARGETS = server client seqnum_server

SOURCES = $(filter-out $(patsubst %,%.c,$(TARGETS)),$(wildcard *.c))
OBJECTS = $(patsubst %.c,%.o,$(SOURCES))

.PHONY: all clean

all: $(TARGETS)
	@$(MAKE) -C url_handler all

clean:
	rm -f $(TARGETS) *.o
	@$(MAKE) -C url_handler clean


$(TARGETS): %: %.o $(OBJECTS)
	$(CC) $^ -o $@ $(LDFLAGS)

%.o: %.c $(wildcard *.h)
	$(CC) $(CFLAGS) -c -o $@ $<