You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile.inc 510B

8 years ago
12345678910111213141516171819202122232425262728293031323334
  1. OBJECTS = $(patsubst %, build/%.o, $(SOURCES))
  2. DEPS = $(patsubst %, build/%.d, $(SOURCES))
  3. # Final targets
  4. $(TARGET): $(OBJECTS)
  5. $(CXX) -o $@ $^ $(LDFLAGS)
  6. # Object targets
  7. -include $(DEPS)
  8. build/%.c.o: %.c
  9. @mkdir -p $(@D)
  10. $(CC) $(CFLAGS) -c -o $@ $<
  11. build/%.cpp.o: %.cpp
  12. @mkdir -p $(@D)
  13. $(CXX) $(CXXFLAGS) -c -o $@ $<
  14. build/%.cc.o: %.cc
  15. @mkdir -p $(@D)
  16. $(CXX) $(CXXFLAGS) -c -o $@ $<
  17. build/%.m.o: %.m
  18. @mkdir -p $(@D)
  19. $(CC) $(CFLAGS) -c -o $@ $<
  20. # Utilities
  21. clean:
  22. rm -rf build $(TARGET)