3 # This creates a program
6 # $(SOURCE) - The source code to use
7 # $(PROGRAM) - The name of the program
8 # $(SLIBS) - Shared libs to link against
10 # See defaults.mak for information about LOCAL
12 # Some local definitions
14 $(LOCAL)-OBJS := $(addprefix $(OBJ)/,$(addsuffix .o,$(notdir $(basename $(SOURCE)))))
15 $(LOCAL)-DEP := $(addprefix $(DEP)/,$(addsuffix .o.d,$(notdir $(basename $(SOURCE)))))
16 $(LOCAL)-BIN := $(BIN)/$(PROGRAM)
17 $(LOCAL)-SLIBS := $(SLIBS)
19 # Install the command hooks
20 program: $(BIN)/$(PROGRAM)
22 veryclean: veryclean/$(LOCAL)
25 .PHONY: clean/$(LOCAL) veryclean/$(LOCAL)
27 -rm -f $($(@F)-OBJS) $($(@F)-DEP)
28 veryclean/$(LOCAL): clean/$(LOCAL)
31 # The binary build rule
32 $($(LOCAL)-BIN): $($(LOCAL)-OBJS)
33 echo Building program $@
34 $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LFLAGS) -o $@ $(filter %.o,$^) $($(LOCAL)-SLIBS)
39 echo Compiling $< to $@
40 $(CXX) -c $(INLINEDEPFLAG) $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
43 # Include the dependencies that are available
44 The_DFiles = $(wildcard $($(LOCAL)-DEP))
45 ifneq ($(words $(The_DFiles)),0)