Skip to content

Instantly share code, notes, and snippets.

@oktomus
Created February 12, 2017 11:31
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 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