Use a Linux kernel style build output printing.

Example:

$ make install
  BUILD   lib
  CC      gpio.o
  AR      libopenstm32.a
  BUILD   example
  CC      blink.o
  LD      blink
  INSTALL headers
  INSTALL lib

$ make clean
  CLEAN   blink.o
  CLEAN   blink
  CLEAN   gpio.o
  CLEAN   libopenstm32.a
This commit is contained in:
Uwe Hermann 2009-07-16 15:15:26 +02:00
parent 1c459b8c48
commit 3a2c63129e
3 changed files with 27 additions and 5 deletions

View File

@ -35,16 +35,28 @@ endif
all: build
build:
build: lib example
lib:
@printf " BUILD lib\n"
$(Q)$(MAKE) -C lib all
example: lib
@printf " BUILD example\n"
$(Q)$(MAKE) -C example all
install: build
@printf " INSTALL headers\n"
$(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
@printf " INSTALL lib\n"
$(Q)$(INSTALL) -m 0644 lib/*.a $(LIBDIR)
clean:
$(Q)$(MAKE) -C example clean
$(Q)$(MAKE) -C lib clean
.PHONY: build lib example install clean

View File

@ -37,11 +37,16 @@ endif
all: $(BINARY)
$(BINARY): $(OBJS) $(BINARY).ld
@printf " LD $(subst $(shell pwd)/,,$(@))\n"
$(Q)$(LD) $(LDFLAGS) -o $(BINARY) $(OBJS) -lopenstm32
$(BINARY).o: $(BINARY).c
$(Q)$(CC) $(CFLAGS) -c $(BINARY).c
%.o: %.c
@printf " CC $(subst $(shell pwd)/,,$(@))\n"
$(Q)$(CC) $(CFLAGS) -o $@ -c $<
clean:
$(Q)rm -f *.o $(BINARY)
@printf " CLEAN $(subst $(shell pwd)/,,$(OBJS))\n"
$(Q)rm -f *.o
@printf " CLEAN $(BINARY)\n"
$(Q)rm -f $(BINARY)

View File

@ -38,11 +38,16 @@ endif
all: $(LIBNAME).a
$(LIBNAME).a: $(OBJS)
@printf " AR $(subst $(shell pwd)/,,$(@))\n"
$(Q)$(AR) $(ARFLAGS) $@ $^
%.o: %.c
@printf " CC $(subst $(shell pwd)/,,$(@))\n"
$(Q)$(CC) $(CFLAGS) -o $@ -c $<
clean:
$(Q)rm -f *.o $(LIBNAME).a
@printf " CLEAN $(subst $(shell pwd)/,,$(OBJS))\n"
$(Q)rm -f *.o
@printf " CLEAN $(LIBNAME).a\n"
$(Q)rm -f $(LIBNAME).a