Files
finit/common.mk
T
Joachim Nilsson 4657d9713a Minor cleanup. Moved code around a bit, to functions, away from main().
This commit is in preparation for importing the Westermo code changes.
Slowly refactoring the finit core into a more modularized unit to be a
bit more maintainable.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2012-09-17 01:51:37 +02:00

21 lines
744 B
Makefile

# Some junk files we always want to be removed when doing a make clean.
JUNK = *~ *.bak *.aux *.dvi *.idx *.ind *.log *.ps *.map .*.d DEADJOE semantic.cache *.gdb *.elf core core.*
RM := -@$(RM)
MAKE := @$(MAKE)
MAKEFLAGS = --no-print-directory
# Smart autodependecy generation via GCC -M.
.%.d: %.c
@$(SHELL) -ec "$(CC) -MM $(CFLAGS) $(CPPFLAGS) $< \
| sed 's,.*: ,$*.o $@ : ,g' > $@; \
[ -s $@ ] || rm -f $@"
# Override default implicit rules
%.o: %.c
@printf " CC $(subst $(ROOTDIR)/,,$(shell pwd)/$@)\n"
@$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
%: %.o
@printf " LINK $(subst $(ROOTDIR)/,,$(shell pwd)/$@)\n"
@$(CC) $(CFLAGS) $(LDFLAGS) -Wl,-Map,$@.map -o $@ $^ $(LDLIBS$(LDLIBS-$(@)))