From 55116373498382adb8debbf40a48d607a8a610be Mon Sep 17 00:00:00 2001 From: "Dmitrij D. Czarkoff" Date: Thu, 25 Jun 2015 12:43:24 +0200 Subject: Made build process more user-friendly Set CFLAGS that are not absolutely required with CFLAGS?=..., so that user-defined CFLAGS take precedence. Made VERBOSE option that would toggle between silent (previous) and verbose mode of CC directive processing. --- src/Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 406caee..8fb0c87 100644 --- a/src/Makefile +++ b/src/Makefile @@ -23,24 +23,40 @@ $(OBJ): config.h $(BASEDIR)/config.mk $(LOBJ): config.h $(BASEDIR)/config.mk $(TARGET): $(OBJ) +ifeq ($(VERBOSE),0) + $(CC) $(OBJ) -o $@ $(LDFLAGS) +else @echo "$(CC) $@" @$(CC) $(OBJ) -o $@ $(LDFLAGS) +endif $(LIBTARGET): $(LOBJ) +ifeq ($(VERBOSE),0) + $(CC) -shared ${LOBJ} -o $@ $(LDFLAGS) +else @echo "$(CC) $@" @$(CC) -shared ${LOBJ} -o $@ $(LDFLAGS) +endif config.h: @echo create $@ from config.def.h @cp config.def.h $@ %.o: %.c %.h +ifeq ($(VERBOSE),0) @echo "${CC} $@" @$(CC) $(CFLAGS) -c -o $@ $< +else + $(CC) $(CFLAGS) -c -o $@ $< +endif %.lo: %.c %.h +ifeq ($(VERBOSE),0) @echo "${CC} $@" @$(CC) -DTESTLIB $(CFLAGS) -fPIC -c -o $@ $< +else + $(CC) -DTESTLIB $(CFLAGS) -fPIC -c -o $@ $< +endif -include $(OBJ:.o=.d) -- cgit v1.2.3