a branflakes interpreter i used to play with c++
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.

26 lines
695 B

2 years ago
2 years ago
  1. # CC := g++ # This is the main compiler
  2. CC := clang++
  3. SRCDIR := src
  4. BUILDDIR := build
  5. TARGET := bin/bfi
  6. SRCEXT := cpp
  7. SOURCES := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT))
  8. OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.o))
  9. CFLAGS := -g -Wall -std=c++11
  10. LIB := -pthread
  11. INC := -I include
  12. $(TARGET): $(OBJECTS)
  13. @echo " Linking..."
  14. @echo " $(CC) $^ -o $(TARGET) $(LIB)"; $(CC) $^ -o $(TARGET) $(LIB)
  15. $(BUILDDIR)/%.o: $(SRCDIR)/%.$(SRCEXT)
  16. @mkdir -p $(BUILDDIR)
  17. @echo " $(CC) $(CFLAGS) $(INC) -c -o $@ $<"; $(CC) $(CFLAGS) $(INC) -c -o $@ $<
  18. clean:
  19. @echo " Cleaning...";
  20. @echo " $(RM) -r $(BUILDDIR) $(TARGET)"; $(RM) -r $(BUILDDIR) $(TARGET)
  21. .PHONY: clean