ethernetgmii: make design files compile (warning: takes longer than 1 hour)
[ana-net.git] / usr / Makefile
blobe8171b54d27f234f1468a5708973e442c9f9c0fc
2 # Lightweight Autonomic Network Architecture
4 # Copyright 2011 Daniel Borkmann <dborkma@tik.ee.ethz.ch>,
5 # Swiss federal institute of technology (ETH Zurich)
6 # Subject to the GPL.
9 LD_NORM = echo "LD $<"; \
10 gcc -pie -z relo
11 CC_NORM = echo "CC $<"; \
12 gcc
14 LD = $(LD_NORM) -o
15 CC = $(CC_NORM) -c
17 MAKEFLAGS += --no-print-directory
19 BINDIR = usr/sbin
20 ETCDIR = etc
22 CFLAGS += -O2 -fno-delete-null-pointer-checks -std=gnu99 -pedantic
23 CFLAGS += -fstack-protector -D_FORTIFY_SOURCE=2 -fPIE -D_REENTRANT
24 CFLAGS += -fno-strict-aliasing
25 CFLAGS += -Wall -Werror -Wundef -Wstrict-prototypes -Wuninitialized
27 INCLUDE = -I../src/
29 fbctl-libs =
30 fbctl-objs = fbctl.o
31 fbctl-targ = fbctl
33 vlink-libs =
34 vlink-objs = vlink.o
35 vlink-targ = vlink
37 all: build
39 build: build_vlink build_fbctl
41 build_vlink: $(vlink-objs)
42 @$(LD) $(vlink-targ) $(vlink-objs) $(vlink-libs)
44 build_fbctl: $(fbctl-objs)
45 @$(LD) $(fbctl-targ) $(fbctl-objs) $(fbctl-libs)
47 %.o: %.c
48 @$(CC) $(CFLAGS) $(INCLUDE) $<
50 install:
51 @install -D $(vlink-targ) $(DESTDIR)/$(BINDIR)/$(vlink-targ)
52 @install -D $(fbctl-targ) $(DESTDIR)/$(BINDIR)/$(fbctl-targ)
54 uninstall:
55 @rm $(DESTDIR)/$(BINDIR)/$(vlink-targ)
56 @rm $(DESTDIR)/$(BINDIR)/$(fbctl-targ)
58 clean:
59 @rm *.o *~ $(vlink-targ) $(fbctl-targ) || true
60 @find -name "*\.o" -exec rm '{}' \; || true
61 @find -name "*\.hi" -exec rm '{}' \; || true
62 @rm bpfc || true
64 help:
65 @echo "make <targets>"
66 @echo "available targets:"
67 @echo " build - Builds source"
68 @echo " clean - Removes generated files"
69 @echo " install - Installs userspace tools into system"
70 @echo " uninstall - Removes userspace tools from system"
71 @echo " help - Shows this help"