summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile58
1 files changed, 20 insertions, 38 deletions
diff --git a/Makefile b/Makefile
index 6d7fea8..36f6f29 100644
--- a/Makefile
+++ b/Makefile
@@ -134,7 +134,10 @@ MODULESKO:=$(MODULES:%=%.ko)
ifneq (,$(wildcard /usr/include/newt.h))
ZTTOOL:=zttool
endif
-BINS=ztcfg torisatool makefw ztmonitor ztspeed $(ZTTOOL) zttest fxotune
+BINS:=ztcfg sethdlc-new ztmonitor ztspeed $(ZTTOOL) zttest fxotune
+UTILS:=tor2ee ztspeed zttool ztmonitor sethdlc-new \
+ usbfxstest fxstest fxotune fxsdump ztdiag
+UTILSO:=$(UTILS:%=%.o)
#PRIMARY=wcfxsusb
PRIMARY=torisa
@@ -208,8 +211,7 @@ $(MODULESO): %.o: %.c zaptel.h
tor2ee.o: tor2-hw.h
-tor2ee: tor2ee.o
- $(CC) $(CFLAGS) -o $@ $^ -lpci
+tor2ee: LDFLAGS+=-lpci
zonedata.lo: zonedata.c
$(CC) -c $(LCFLAGS) -o $@ $^
@@ -229,8 +231,7 @@ tor2fw.h: makefw tormenta2.rbt
radfw.h: makefw pciradio.rbt
./makefw pciradio.rbt radfw > radfw.h
-gendigits: gendigits.o
- $(CC) -o $@ $^ -lm
+gendigits: LDFLAGS+=-lm
zaptel.c: tones.h
@@ -242,23 +243,10 @@ ztprovision.o: ztprovision.c zaptel.h
ztmonitor.o: ztmonitor.c zaptel.h
-ztspeed.o: ztspeed.c
- $(CC) -o $@ -c $^
-
-zttool: zttool.o
- $(CC) -o $@ $^ -lnewt
-
-ztmonitor: ztmonitor.o
- $(CC) -o $@ $^
-
-ztspeed: ztspeed.o
- $(CC) -o $@ $^
-
-sethdlc-new: sethdlc-new.o
- $(CC) -o $@ $^
-
-sethdlc-new.o: sethdlc-new.c
- $(CC) -o $@ -c $(CFLAGS) -I$(KINCLUDES) $^
+ztspeed: CFLAGS=
+ztspeed.o: CFLAGS=
+zttool: LDFLAGS+=-lnewt
+sethdlc-new.o: CFLAGS+=-I$(KINCLUDES)
libtonezone.a: $(TZOBJS)
ar rcs libtonezone.a $^
@@ -283,26 +271,20 @@ mknotch.o: mknotch.cc
complex.o: complex.cc
$(CC) -o $@ -c $^
-usbfxstest.o: usbfxstest.c
- $(CC) -o $@ -g -c $^
-
-usbfxstest: usbfxstest.o
- $(CC) -o $@ $^ -lzap
-
-fxstest: fxstest.o $(LIBTONEZONE_SO)
- $(CC) -o $@ $^ -lm
-
-fxotune: fxotune.o
- $(CC) -o $@ $^ -lm
-
-fxsdump: fxsdump.o
- $(CC) -o $@ $^ -lm
+usbfxstest: LDFLAGS+=-lzap
+fxstest: $(LIBTONEZONE_SO)
+fxstest: LDFLAGS+=-lm
+fxotune: LDFLAGS+=-lm
+fxsdump: LDFLAGS+=-lm
stackcheck: checkstack $(BUILDVER)
./checkstack *.o
-ztdiag: ztdiag.o
- $(CC) -o $@ $^
+$(UTILS): %: %.o
+ $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
+
+$(UTILSO): %.o: %.c
+ $(CC) $(CFLAGS) -o $@ -c $<
devices:
ifndef DYNFS