Skip to content

Instantly share code, notes, and snippets.

@japodhidev
Created March 18, 2018 08:11
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 japodhidev/081e5b3712b8e11c1e1280db578a5a62 to your computer and use it in GitHub Desktop.
Save japodhidev/081e5b3712b8e11c1e1280db578a5a62 to your computer and use it in GitHub Desktop.
Simplistic view of a basic makefile
CC=g++
CPPFLAGS= -Wall -g -std=c++11
LINK_TARGET = test.exe
RES_OBJS = res.o
REB_OBJS = test.o
REBUILDABLES = $(LINK_TARGET) $(REB_OBJS)
VPATH = src
main:
$(CC) $(CPPFLAGS) -c test.cpp
$(CC) $(CPPFLAGS) -o $(LINK_TARGET) $(REB_OBJS) $(VPATH)/$(RES_OBJS)
# Verbose mode
verbose:
$(CC) $(CFLAGS) -v -o $(LINK_TARGET) $(VPATH)/$(RES_OBJS) test.cpp
clean:
rm -f $(REBUILDABLES)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment