Skip to content

Instantly share code, notes, and snippets.

@exallium
Created July 30, 2011 18:32
Show Gist options
  • Save exallium/1115832 to your computer and use it in GitHub Desktop.
Save exallium/1115832 to your computer and use it in GitHub Desktop.
Generalized Makefile for basically any C/C++ project
CC=
CFLAGS=
LDFLAGS=
SOURCE=
OBJECTS=$(SOURCE:.cpp=.o)
TARGET=
all: $(SOURCE) $(TARGET)
$(TARGET): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) -o $@
$(SOURCE):
$(CC) $(CFLAGS) $< -o $@
clean:
rm $(OBJECTS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment