-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathMakefile
54 lines (42 loc) · 1014 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
45
46
47
48
49
50
51
52
53
54
# use this to disable flto optimizations:
# make NO_FLTO=1
# and this to enable verbose mode:
# make V=1
TARGET=eoip
ifndef NO_FLTO
CFLAGS?=-O3 -fno-stack-protector -mno-stackrealign -flto
LDFLAGS+=-O3 -fno-stack-protector -mno-stackrealign -flto
else
CFLAGS?=-O3 -fno-stack-protector -mno-stackrealign
endif
STRIP?=strip
PREFIX?=$(DESTDIR)/
MYCFLAGS:=$(CPPFLAGS) $(CFLAGS) -std=gnu90 -Wall -Wextra
MYLDFLAGS=$(LDFLAGS)
ifeq ("$(V)","1")
Q:=
E:=@true
else
Q:=@
E:=@echo
endif
all: $(TARGET)
eoip: eoipcr.o libnetlink.o
$(E) LD $@
$(Q)$(CC) -o $@ $^ $(MYLDFLAGS)
libnetlink.o: libnetlink.c libnetlink.h
$(E) CC $@
$(Q)$(CC) $(MYCFLAGS) -c -o $@ $<
eoipcr.o: eoipcr.c libnetlink.h version.h
$(E) CC $@
$(Q)$(CC) $(MYCFLAGS) -c -o $@ $<
install: $(TARGET)
$(E) STRIP $(TARGET)
$(Q)$(STRIP) $(TARGET)
$(E) INSTALL $(TARGET)
$(Q)install -TD -m 0755 $(TARGET) $(PREFIX)sbin/$(TARGET)
uninstall:
$(E) UNINSTALL $(TARGET)
$(Q)rm $(PREFIX)sbin/$(TARGET)
clean:
rm -f eoip eoipcr.o libnetlink.o