aboutsummaryrefslogtreecommitdiff
path: root/Semestr 4/sieci/pracownia2/router/makefile
blob: 7d8aaefe2baa54ac0d0c30bb0e1c57a6363bff60 (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
25
CC				:= gcc
CFLAGS 		:= -Og -std=gnu17 -Wall -Wall -fsanitize=address -fsanitize=undefined
TARGET 		:= router
DEPS			:= config.h

ODIR			:= obj
_OBJ	 		:= router.o utils.o linked_list.o network_addr.o dist_vector.o
OBJ				:= $(patsubst %,$(ODIR)/%,$(_OBJ))

all: $(TARGET)

$(ODIR)/%.o: %.c $(DEPS)
	$(CC) $(CFLAGS) -c -o $@ $<

$(TARGET): $(OBJ)
	$(CC) -o $@ $^ $(CFLAGS)

clean:
	rm -rf $(TARGET)
	rm -rf test

distclean:
	rm -rf $(TARGET)
	rm -rf test
	rm -rf $(ODIR)/*.o