Skip to content

Instantly share code, notes, and snippets.

@AndyNovo
Created September 22, 2015 23:04
Show Gist options
  • Save AndyNovo/233c419686f0b96b3bf8 to your computer and use it in GitHub Desktop.
Save AndyNovo/233c419686f0b96b3bf8 to your computer and use it in GitHub Desktop.
CC=g++
CFLAGS=-c -Wall
LDFLAGS=
SOURCES=main.cpp hello.cpp factorial.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=hello
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) -o $@
.cpp.o:
$(CC) $(CFLAGS) $< -o $@
@AndyNovo
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment