Browse Source

make: use $@ and $<

dev/timer
René Kijewski 9 years ago
parent
commit
aa2ee4084d
  1. 17
      Makefile.base

17
Makefile.base

@ -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)

Loading…
Cancel
Save