Allow parallel make of netem directory.
Use HOSTCC when building local tools
diff --git a/netem/Makefile b/netem/Makefile
index 881ed9f..6af5cf1 100644
--- a/netem/Makefile
+++ b/netem/Makefile
@@ -1,17 +1,20 @@
DISTGEN = maketable normal pareto paretonormal
DISTDATA = normal.dist pareto.dist paretonormal.dist experimental.dist
+HOSTCC ?= $(CC)
LDLIBS += -lm
-%.dist: %.c
- $(HOSTCC) $(CFLAGS) -o $* $< -lm
- ./$* >$@
-
-%.dist: %.dat
- ./maketable $< >$@
-
all: $(DISTGEN) $(DISTDATA)
+$(DISTGEN):
+ $(HOSTCC) -Wall -O1 -I../include -o $@ $@.c -lm
+
+%.dist: %
+ ./$* > $@
+
+experimental.dist: maketable experimental.dat
+ ./maketable experimental.dat > experimental.dist
+
install: all
mkdir -p $(DESTDIR)/usr/lib/tc
for i in $(DISTDATA); \
@@ -20,8 +23,3 @@
clean:
rm -f $(DISTDATA) $(DISTGEN)
-
-maketable: maketable.c
- $(HOSTCC) $(CFLAGS) -o $@ $< -lm
-
-