summaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
authorDmitrij D. Czarkoff <czarkoff@gmail.com>2015-06-25 12:43:24 +0200
committerDmitrij D. Czarkoff <czarkoff@gmail.com>2015-06-25 13:04:07 +0200
commit55116373498382adb8debbf40a48d607a8a610be (patch)
treea04ba71a598fa9dacb9a9797a979740755518318 /src/Makefile
parent4d9c39b6294933a973b06c20be757a3262ad7710 (diff)
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.
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile16
1 files changed, 16 insertions, 0 deletions
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)