Skip to content

Instantly share code, notes, and snippets.

@oktomus
Created February 12, 2017 11:31
Show Gist options
  • Save oktomus/bbeef2cedb7d543b601fab2a0643ead4 to your computer and use it in GitHub Desktop.
Save oktomus/bbeef2cedb7d543b601fab2a0643ead4 to your computer and use it in GitHub Desktop.
Makefile : executable for each source file
CXX=g++
FLAGS=-Wall
LFLAGS=-lglut -lGL -lGLU
SRC=.
EXEC=.
SRCS=$(wildcard $(SRC)/*.cpp)
EXECS=$(SRCS:$(SRC)/%.cpp=$(EXEC)/%.out)
all: $(EXECS)
%.out: %.cpp
$(CXX) $(FLAGS) -o $@ $< $(LFLAGS)
chmod u+x $@
clean:
rm -f $(EXECS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment