Makefile 626 B

12345678910111213141516171819202122232425262728293031
  1. # Utilities
  2. RM = rm -rf
  3. EXEC = exec
  4. # Artifacts
  5. OBJS = functions.out methods.out stack.out types.out
  6. DEPS = $(OBJS:%=%.d)
  7. # Compiler
  8. CXX ?= clang++
  9. CXXFLAGS += -std=c++14 -O2 -fno-exceptions -fno-rtti -fmessage-length=0 -Wall -Wextra \
  10. -pedantic -I../lib
  11. LDLIBS += -llua
  12. # Default Targets
  13. all: $(OBJS) $(foreach obj,$(OBJS),exec-$(obj))
  14. exec-%: %
  15. $(EXEC) ./$<
  16. clean:
  17. $(RM) $(DEPS) $(OBJS)
  18. # Objects
  19. -include $(DEPS)
  20. %.out: %.cpp Makefile
  21. $(CXX) $(CXXFLAGS) -MMD -MF$(@:%=%.d) -MT$@ -o$@ $< $(LDLIBS)
  22. # Phony
  23. .PHONY: clean