Skip to content

Commit

Permalink
make: use $@ and $<
Browse files Browse the repository at this point in the history
  • Loading branch information
Kijewski committed Aug 13, 2014
1 parent 346313b commit aa2ee40
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions Makefile.base
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,22 @@ $(BINDIR)$(MODULE)/:
$(BINDIR)$(MODULE).a: $(OBJ) $(ASMOBJ) ${DIRS:%=ALL--%} $(BINDIR)$(MODULE)/
$(AD)$(AR) -rc $(BINDIR)$(MODULE).a $(OBJ) $(ASMOBJ)

# pull in dependency info for *existing* .o files
# deleted header files will be silently ignored
-include $(OBJ:.o=.d)
CXXFLAGS = $(filter-out $(CXXUWFLAGS), $(CFLAGS)) $(CXXEXFLAGS)

# compile and generate dependency info

$(BINDIR)$(MODULE)/%.o: %.c $(BINDIR)$(MODULE)/
$(AD)$(CC) $(CFLAGS) $(INCLUDES) -MD -MP -c -o $(BINDIR)$(MODULE)/$*.o $(abspath $*.c)
$(AD)$(CC) $(CFLAGS) $(INCLUDES) -MD -MP -c -o $@ $(abspath $<)

$(BINDIR)$(MODULE)/%.o: %.cpp $(BINDIR)$(MODULE)/
$(AD)$(CXX) $(filter-out $(CXXUWFLAGS), $(CFLAGS)) $(CXXEXFLAGS) $(INCLUDES) -MD -MP -c -o $(BINDIR)$(MODULE)/$*.o $(abspath $*.cpp)
$(AD)$(CXX) $(CXXFLAGS) $(INCLUDES) -MD -MP -c -o $@ $(abspath $<)

$(BINDIR)$(MODULE)/%.o: %.s $(BINDIR)$(MODULE)/
$(AD)$(AS) $(ASFLAGS) $*.s -o $(BINDIR)$(MODULE)/$*.o
$(AD)$(AS) $(ASFLAGS) -o $@ $(abspath $<)

$(BINDIR)$(MODULE)/%.o: %.S $(BINDIR)$(MODULE)/
$(AD)$(CC) $(CFLAGS) $(INCLUDES) -MD -MP -c -o $(BINDIR)$(MODULE)/$*.o $(abspath $*.S)
$(AD)$(CC) $(CFLAGS) $(INCLUDES) -MD -MP -c -o $@ $(abspath $<)

# pull in dependency info for *existing* .o files
# deleted header files will be silently ignored
-include $(OBJ:.o=.d)

0 comments on commit aa2ee40

Please sign in to comment.