-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (30 loc) · 919 Bytes
/
Makefile
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
PROJECT=router
SOURCES=router.c lib/queue.c lib/list.c lib/lib.c
LIBRARY=nope
INCPATHS=include
LIBPATHS=.
LDFLAGS=
CFLAGS=-c -Wall -Werror -Wno-error=unused-variable
CC=gcc
# Automatic generation of some important lists
OBJECTS=$(SOURCES:.c=.o)
INCFLAGS=$(foreach TMP,$(INCPATHS),-I$(TMP))
LIBFLAGS=$(foreach TMP,$(LIBPATHS),-L$(TMP))
# Set up the output file names for the different output types
BINARY=$(PROJECT)
all: $(SOURCES) $(BINARY)
$(BINARY): $(OBJECTS)
$(CC) $(LIBFLAGS) $(OBJECTS) $(LDFLAGS) -o $@
.c.o:
$(CC) $(INCFLAGS) $(CFLAGS) -fPIC $< -o $@
clean:
rm -rf $(OBJECTS) router hosts_output router_*
run_router0: all
./router rtable0.txt rr-0-1 r-0 r-1
run_router1: all
./router rtable1.txt rr-0-1 r-0 r-1
archive:
rm -f ~/Downloads/PCOM-tema-1-322CDa-Trifan-Bogdan-Cristian.zip
./create_archive.sh
cp archive.zip ~/Downloads/PCOM-tema-1-322CDa-Trifan-Bogdan-Cristian.zip
zip: archive