|
-
- OBJECTS = $(patsubst %, build/%.o, $(SOURCES))
- DEPS = $(patsubst %, build/%.d, $(SOURCES))
-
-
- # Final targets
-
- $(TARGET): $(OBJECTS)
- $(CXX) -o $@ $^ $(LDFLAGS)
-
- # Object targets
-
- -include $(DEPS)
-
- build/%.c.o: %.c
- @mkdir -p $(@D)
- $(CC) $(CFLAGS) -c -o $@ $<
-
- build/%.cpp.o: %.cpp
- @mkdir -p $(@D)
- $(CXX) $(CXXFLAGS) -c -o $@ $<
-
- build/%.cc.o: %.cc
- @mkdir -p $(@D)
- $(CXX) $(CXXFLAGS) -c -o $@ $<
-
- build/%.m.o: %.m
- @mkdir -p $(@D)
- $(CC) $(CFLAGS) -c -o $@ $<
-
- # Utilities
-
- clean:
- rm -rf build $(TARGET)
|