convert kmeans_incr threshold
[actl.git] / Makefile.gnu
blobac0a854ca919e88d8d0857516687d40c353e72e3
1 LEX=lex
2 YACC= yacc
3 CFLAGS+= -Wall -I. -g $(shell pkg-config --cflags libkqueue)
4 CFLAGS+= -include bsd/stdlib.h
5 LDLIBS+= -ldl -lof -ldht -lpthread -lhashtab $(shell pkg-config --libs libkqueue libbsd)
6 SRCS=$(wildcard *.c)
7 OBJS=$(patsubst %.c, %.o, $(SRCS))
8 all: actl apps
9 %.o: %.c 
10         $(CC) -o $@ -c $< $(CFLAGS)
11 y.tab.c y.tab.h: parse.y
12         $(YACC) -d parse.y
13 lex.yy.c: lex.l
14         $(LEX) lex.l
15 actl: $(OBJS) y.tab.o lex.yy.o
16         $(CC) -o $@ $^ $(CFLAGS) $(LDLIBS)
17 apps:
18         $(MAKE) -C app-l2_hub -f Makefile.gnu
19         $(MAKE) -C app-l2_learn -f Makefile.gnu
20         $(MAKE) -C app-l3_lb -f Makefile.gnu
21 apps_install: apps
22         $(MAKE) -C app-l2_hub -f Makefile.gnu install
23         $(MAKE) -C app-l2_learn -f Makefile.gnu install
24         $(MAKE) -C app-l3_lb -f Makefile.gnu install
25 install: actl apps_install
26         install -m 0555 actl /usr/sbin/actl
27 apps_clean:
28         $(MAKE) -C app-l2_hub -f Makefile.gnu clean
29         $(MAKE) -C app-l2_learn -f Makefile.gnu clean
30         $(MAKE) -C app-l3_lb -f Makefile.gnu clean
31 clean: apps_clean
32         rm -f *.o y.tab.* lex.yy.*