Skip to content

Commit

Permalink
Build: show directory during compilation, remove default rules
Browse files Browse the repository at this point in the history
When using -j, it can be confusing to see files being compiled out
of order, so prefix compilation with the directory it's building
for.
  • Loading branch information
jcs authored and awesomekling committed Jan 1, 2020
1 parent a1fd2eb commit 99e06c5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,26 @@ endif

-include $(SUFFIXED_OBJS:%.o=%.d)

.SUFFIXES:

%$(OBJ_SUFFIX).o: %.cpp $(EXTRA_SOURCES)
@echo "C++ $@"
@echo "$(notdir $(CURDIR)): C++ $@"
$(QUIET) $(CXX) $(CXXFLAGS) -o $@ -c $<

%$(OBJ_SUFFIX).o: %.c
@echo "C $@"
@echo "$(notdir $(CURDIR)): C $@"
$(QUIET) $(CC) $(CFLAGS) -o $@ -c $<

%.ao: %.S
@echo "AS $@"
@echo "$(notdir $(CURDIR)): AS $@"
$(QUIET) $(AS) -o $@ $<

$(PROGRAM): $(STATIC_LIB_DEPS) $(SUFFIXED_OBJS) $(EXTRA_OBJS)
@echo "LINK $(PROGRAM)"
@echo "$(notdir $(CURDIR)): LINK $(PROGRAM)"
$(QUIET) $(CXX) -o $(PROGRAM) $(EXTRA_OBJS) $(SUFFIXED_OBJS) $(LDFLAGS)

$(LIBRARY): $(SUFFIXED_OBJS) $(EXTRA_OBJS)
@echo "LIB $@"
@echo "$(notdir $(CURDIR)): LIB $@"
$(QUIET) $(AR) rcs $@ $(OBJS) $(EXTRA_OBJS) $(LIBS)
$(POST_LIBRARY_BUILD)

Expand All @@ -126,7 +128,7 @@ all: $(PROGRAM) $(LIBRARY)
EXTRA_CLEAN ?=

clean:
@echo "CLEAN"
@echo "$(notdir $(CURDIR)): CLEAN"
$(QUIET) rm -f $(PROGRAM) $(LIBRARY) $(SUFFIXED_OBJS) $(EXTRA_OBJS) *.d $(EXTRA_CLEAN)

install:
Expand Down

0 comments on commit 99e06c5

Please sign in to comment.