Skip to content

Instantly share code, notes, and snippets.

@equinoxel
Created December 20, 2015 23:40
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 equinoxel/a200c44ffd26284795b9 to your computer and use it in GitHub Desktop.
Save equinoxel/a200c44ffd26284795b9 to your computer and use it in GitHub Desktop.
.PHONY: depend clean
all: $(MAIN)
@echo Polymorph binary has been compiled
$(MAIN): $(OBJS)
$(CXX) $(CXXFALGS) $(INCLUDES) -o $(MAIN) $(OBJS) $(LFLAGS) $(LIBS)
# this is a suffix replacement rule for building .o's from .c's
# it uses automatic variables $<: the name of the prerequisite of
# the rule(a .c file) and $@: the name of the target of the rule (a .o file)
# (see the gnu make manual section about automatic variables)
.c.o:
$(CXX) $(CXXFALGS) $(INCLUDES) -c $< -o $@
clean:
$(RM) *.o *~ $(MAIN)
depend: $(SRCS)
makedepend $(INCLUDES) $^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment