Skip to content

Instantly share code, notes, and snippets.

@LinArcX
Created May 28, 2019 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LinArcX/820c8b67ffb8fbbbbf2f4f835f201f83 to your computer and use it in GitHub Desktop.
Save LinArcX/820c8b67ffb8fbbbbf2f4f835f201f83 to your computer and use it in GitHub Desktop.
TARGET = main
LIBS = `pkg-config --libs -cflags gtkmm-3.0`
CXX = g++
CFLAGS = -g -Wall
ODIR = ./build
SDIR = ./src
OBJECTS = $(patsubst $(SDIR)/**/%.cpp, $(ODIR)/%.o, $(wildcard $(SDIR)/*.cpp))
HEADERS = $(wildcard $(SDIR)/*.h)
.PHONY: default all clean
.PRECIOUS: $(TARGET) $(OBJECTS)
default: $(ODIR)/$(TARGET)
all: default
$(ODIR)/%.o: $(SDIR)/%.cpp $(HEADERS)
$(CXX) $(CFLAGS) -c $< -o $@ $(LIBS)
$(ODIR)/$(TARGET): $(OBJECTS)
$(CXX) $(OBJECTS) -Wall $(LIBS) -o $@
clean:
-rm -f $(ODIR)/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment