forked from pandax381/microps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (57 loc) · 1.49 KB
/
Makefile
File metadata and controls
70 lines (57 loc) · 1.49 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
59
60
61
62
63
64
65
66
67
68
69
70
APPS =
DRIVERS = driver/dummy.o \
driver/loopback.o \
OBJS = util.o \
net.o \
ip.o \
icmp.o \
ether.o \
arp.o \
udp.o \
TESTS = test/step0.exe \
test/step1.exe \
test/step2.exe \
test/step3.exe \
test/step4.exe \
test/step5.exe \
test/step6.exe \
test/step7.exe \
test/step8.exe \
test/step9.exe \
test/step10.exe \
test/step11.exe \
test/step12.exe \
test/step13.exe \
test/step14.exe \
test/step15.exe \
test/step16.exe \
test/step17.exe \
test/step18.exe \
test/step19.exe \
test/step20-1.exe \
test/step20-2.exe \
test/step21.exe \
CFLAGS := $(CFLAGS) -g -W -Wall -Wno-unused-parameter -iquote .
ifeq ($(shell uname),Linux)
# Linux specific settings
BASE = platform/linux
CFLAGS := $(CFLAGS) -pthread -iquote $(BASE)
LDFLAGS := $(LDFLAGS) -lrt
DRIVERS := $(DRIVERS) $(BASE)/driver/ether_tap.o
OBJS := $(OBJS) $(BASE)/intr.o $(BASE)/sched.o
endif
ifeq ($(shell uname),Darwin)
# macOS specific settings
endif
.SUFFIXES:
.SUFFIXES: .c .o
.PHONY: all clean
all: $(APPS) $(TESTS)
$(APPS): %.exe : %.o $(OBJS) $(DRIVERS)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
$(TESTS): %.exe : %.o $(OBJS) $(DRIVERS) test/test.h
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
.c.o:
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -rf $(APPS) $(APPS:.exe=.o) $(OBJS) $(DRIVERS) $(TESTS) $(TESTS:.exe=.o)