From c35166595dd252f23fd6de9b58a94612a1d12627 Mon Sep 17 00:00:00 2001 From: Ivan Shapovalov Date: Wed, 11 Apr 2018 21:24:05 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=B4=D0=B4=D0=B5=D1=80=D0=B6?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BA=D1=80=D0=BE=D1=81=D1=81-=D0=BA=D0=BE?= =?UTF-8?q?=D0=BC=D0=BF=D0=B8=D0=BB=D1=8F=D1=86=D0=B8=D0=B8=20=D0=B2=20Mak?= =?UTF-8?q?efile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - по возможности используем встроенные правила Make - не хардкодим имя компилятора --- Makefile | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index 50f8408..a061a41 100755 --- a/Makefile +++ b/Makefile @@ -1,6 +1,5 @@ -CC = gcc -LIBS = -lreadline -CFLAGS = -O2 -g -Wno-unused-result -Wunused +CFLAGS ?= -g -O2 +override CFLAGS += -Wno-unused-result -Wunused OBJS = hdlc.o qcio.o memio.o chipconfig.o @@ -8,7 +7,7 @@ OBJS = hdlc.o qcio.o memio.o chipconfig.o all: qcommand qrmem qrflash qdload mibibsplit qwflash qwdirect qefs qnvram qblinfo qident qterminal qbadblock qflashparm -clean: +clean: rm *.o rm $(all) @@ -21,50 +20,35 @@ sahara.o: sahara.c chipconfig.o: chipconfig.c memio.o: memio.c ptable.o: ptable.c -# $(CC) -c qcio.c qcommand: qcommand.o $(OBJS) - gcc $^ -o $@ $(LIBS) qrmem: qrmem.o $(OBJS) - gcc $^ -o $@ $(LIBS) qrflash: qrflash.o $(OBJS) ptable.o - gcc $^ -o $@ $(LIBS) qwflash: qwflash.o $(OBJS) - gcc $^ -o $@ $(LIBS) #qwimage: qwimage.o $(OBJS) -# gcc $^ -o $@ $(LIBS) qdload: qdload.o sahara.o $(OBJS) ptable.o - gcc $^ -o $@ $(LIBS) qwdirect: qwdirect.o $(OBJS) ptable.o - gcc $^ -o $@ $(LIBS) - + qefs : qefs.o efsio.o $(OBJS) - gcc $^ -o $@ $(LIBS) qnvram : qnvram.o $(OBJS) - gcc $^ -o $@ $(LIBS) - + mibibsplit: mibibsplit.o $(OBJS) - gcc $^ -o $@ $(LIBS) qblinfo: qblinfo.o $(OBJS) - gcc $^ -o $@ $(LIBS) qident: qident.o $(OBJS) - gcc $^ -o $@ $(LIBS) qterminal: qterminal.o $(OBJS) - gcc $^ -o $@ $(LIBS) qbadblock: qbadblock.o $(OBJS) ptable.o - gcc $^ -o $@ $(LIBS) qflashparm: qflashparm.o $(OBJS) - gcc $^ -o $@ $(LIBS) - \ No newline at end of file + +qterminal qcommand: override LDLIBS+=-lreadline -lncurses