-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
78 lines (56 loc) · 1.48 KB
/
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#------------------------------------------------------------------------------
# File: Makefile
#
# Note: This Makefile requires GNU make.
#
# (c) 2001,2000 Stanford University
#
#------------------------------------------------------------------------------
all : sr
CC = gcc -w
OSTYPE = $(shell uname)
ifeq ($(OSTYPE),CYGWIN_NT-5.1)
ARCH = -D_CYGWIN_
endif
ifeq ($(OSTYPE),Linux)
ARCH = -D_LINUX_
SOCK = -lnsl -lresolv
endif
ifeq ($(OSTYPE),SunOS)
ARCH = -D_SOLARIS_
SOCK = -lnsl -lsocket -lresolv
endif
ifeq ($(OSTYPE),Darwin)
ARCH = -D_DARWIN_
SOCK = -lresolv
endif
CFLAGS = -g -Wall -std=gnu99 -D_DEBUG_ -DVNL $(ARCH)
LIBS= $(SOCK) -lm
PFLAGS= -follow-child-processes=yes -cache-dir=/tmp/${USER}
PURIFY= purify ${PFLAGS}
sr_SRCS = vnlconn.c sr_router.c sr_main.c \
sr_if.c sr_rt.c sr_vns_comm.c \
sr_dumper.c sha1.c
sr_OBJS = $(patsubst %.c,%.o,$(sr_SRCS))
sr_DEPS = $(patsubst %.c,.%.d,$(sr_SRCS))
$(sr_OBJS) : %.o : %.c
$(CC) -c $(CFLAGS) $< -o $@
$(sr_DEPS) : .%.d : %.c
$(CC) -MM $(CFLAGS) $< > $@
include $(sr_DEPS)
sr : $(sr_OBJS)
$(CC) $(CFLAGS) -o sr $(sr_OBJS) $(LIBS)
sr.purify : $(sr_OBJS)
$(PURIFY) $(CC) $(CFLAGS) -o sr.purify $(sr_OBJS) $(LIBS)
.PHONY : clean clean-deps dist
clean:
rm -f *.o *~ core sr *.dump *.tar tags
clean-deps:
rm -f .*.d
dist-clean: clean clean-deps
rm -f .*.swp sr_stub.tar.gz
dist: dist-clean
(cd ..; tar -X stub/exclude -cvf sr_stub.tar stub/; gzip sr_stub.tar); \
mv ../sr_stub.tar.gz .
tags:
ctags *.c