aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile22
-rw-r--r--lib/Makefile15
2 files changed, 27 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 02cb0eb..88bd0bf 100644
--- a/Makefile
+++ b/Makefile
@@ -25,18 +25,26 @@ INCLUDEDIR = $(DESTDIR)/$(PREFIX)/include
LIBDIR = $(DESTDIR)/$(PREFIX)/lib
INSTALL = install
+# Do not print "Entering directory ...".
+MAKEFLAGS += --no-print-directory
+
+# Be silent per default, but 'make V=1' will show all compiler calls.
+ifneq ($(V),1)
+Q := @
+endif
+
all: build
build:
- $(MAKE) -C lib all
+ $(Q)$(MAKE) -C lib all
install: build
- $(INSTALL) -d $(INCLUDEDIR)/libopenstm32
- $(INSTALL) -d $(LIBDIR)
- $(INSTALL) -m 0644 include/libopenstm32.h $(INCLUDEDIR)
- $(INSTALL) -m 0644 include/libopenstm32/*.h $(INCLUDEDIR)/libopenstm32
- $(INSTALL) -m 0644 lib/*.a $(LIBDIR)
+ $(Q)$(INSTALL) -d $(INCLUDEDIR)/libopenstm32
+ $(Q)$(INSTALL) -d $(LIBDIR)
+ $(Q)$(INSTALL) -m 0644 include/libopenstm32.h $(INCLUDEDIR)
+ $(Q)$(INSTALL) -m 0644 include/libopenstm32/*.h $(INCLUDEDIR)/libopenstm32
+ $(Q)$(INSTALL) -m 0644 lib/*.a $(LIBDIR)
clean:
- $(MAKE) -C lib clean
+ $(Q)$(MAKE) -C lib clean
diff --git a/lib/Makefile b/lib/Makefile
index 8a56abf..d3eb2c4 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -26,14 +26,23 @@ CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CFLAGS = -Os -g -Wall -Wextra -I../include -fno-common \
-mcpu=cortex-m3 -mthumb
-ARFLAGS = rcsv
+# ARFLAGS = rcsv
+ARFLAGS = rcs
OBJS = gpio.o
+# Be silent per default, but 'make V=1' will show all compiler calls.
+ifneq ($(V),1)
+Q := @
+endif
+
all: $(LIBNAME).a
$(LIBNAME).a: $(OBJS)
- $(AR) $(ARFLAGS) $@ $^
+ $(Q)$(AR) $(ARFLAGS) $@ $^
+
+%.o: %.c
+ $(Q)$(CC) $(CFLAGS) -o $@ -c $<
clean:
- rm -f *.o $(LIBNAME).a
+ $(Q)rm -f *.o $(LIBNAME).a