forked from dancrossnyc/44ripd
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
53 lines (40 loc) · 1.67 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
#
#CC= egcc
FLAGS= -Wall -Werror -ansi -pedantic -std=c11 -I. -DUSE_COMPAT
CFLAGS= $(FLAGS) -O2
SRCS= main.c rip.c lib.c log.c freebsd/sys.c compat.c
OBJS= main.o rip.o lib.o log.o freebsd/sys.o compat.o
PROG= 44ripd
TESTS= testbitvec testipmapfind testipmapnearest \
testisvalidnetmask testnetmask2cidr testrevbits
DTESTS= testipmapinsert
TOBJS= lib.o freebsd/sys.o compat.o log.o
LIBS=
all: $(PROG)
$(PROG): $(OBJS)
$(CC) -o $(PROG) $(OBJS) $(LIBS)
fast$(PROG): $(SRCS) dat.h sys.h rip.h lib.h log.h
$(CC) $(FLAGS) -Ofast -fwhole-program -flto -o fast$(PROG) $(SRCS)
tests: $(TESTS) $(DTESTS)
for t in $(TESTS); do ./$$t; done
./testipmapinsert < testdata/testipmapinsert.data
./testipmapinsert < testdata/testipmapinsert.data2
./testipmapinsert < testdata/testipmapinsert.data3
.c.o:
$(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -f $(PROG) fast$(PROG) $(OBJS) test*.o $(TESTS) $(DTESTS)
testbitvec: testbitvec.o $(TOBJS) dat.h lib.h
$(CC) -o testbitvec testbitvec.o $(TOBJS)
testipmapfind: testipmapfind.o $(TOBJS) dat.h lib.h
$(CC) -o testipmapfind testipmapfind.o $(TOBJS)
testipmapinsert: testipmapinsert.o $(TOBJS) dat.h lib.h
$(CC) -o testipmapinsert testipmapinsert.o $(TOBJS)
testipmapnearest: testipmapnearest.o $(TOBJS) dat.h lib.h
$(CC) -o testipmapnearest testipmapnearest.o $(TOBJS)
testisvalidnetmask: testisvalidnetmask.o $(TOBJS) dat.h lib.h
$(CC) -o testisvalidnetmask testisvalidnetmask.o $(TOBJS)
testnetmask2cidr: testnetmask2cidr.o $(TOBJS) dat.h lib.h
$(CC) -o testnetmask2cidr testnetmask2cidr.o $(TOBJS)
testrevbits: testrevbits.o $(TOBJS) dat.h lib.h
$(CC) -o testrevbits testrevbits.o $(TOBJS)