Skip to content

Instantly share code, notes, and snippets.

@DirkyJerky
Created April 7, 2015 20:28
Show Gist options
  • Save DirkyJerky/b49f51e66ace5cf6d25a to your computer and use it in GitHub Desktop.
Save DirkyJerky/b49f51e66ace5cf6d25a to your computer and use it in GitHub Desktop.
Simple, dynamic, (windows), Makefile
CC := g++
SRCDIR := src
BINDIR := bin
SRCEXT := cpp
SOURCES := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT))
OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.exe))
CFLAGS := -g # -Wall
$(BINDIR)/%.exe: $(SRCDIR)/%.$(SRCEXT)
@mkdir -p $(BINDIR)
@echo " $(CC) $(CFLAGS) -o $@ $<"; $(CC) $(CFLAGS) -o $@ $<
clean:
@echo " Cleaning...";
@echo " $(RM) -r $(BINDIR) $(TARGET)"; $(RM) -r $(BINDIR) $(TARGET)
.PHONY: clean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment