Skip to content

Instantly share code, notes, and snippets.

@xerpi
Created September 20, 2016 15:01
Show Gist options
  • Save xerpi/af9512f6e915fc74d9bb4a1b67cd2bce to your computer and use it in GitHub Desktop.
Save xerpi/af9512f6e915fc74d9bb4a1b67cd2bce to your computer and use it in GitHub Desktop.
VJ Makefile
TARGET = $(notdir $(CURDIR))
CC = gcc
CXX = g++
CFLAGS = -g -O2 -I/usr/include/SOIL
CXXFLAGS = $(CFLAGS)
LIBS = -lSOIL -lglut -lGLEW -lGL -lm
CFILES = $(wildcard *.c)
CPPFILES = $(wildcard *.cpp)
OBJS = $(CPPFILES:.cpp=.o) $(CFILES:.c=.o)
$(TARGET): $(OBJS)
$(CXX) -o $@ $^ $(CFLAGS) $(LIBS)
%.o: %.c
$(CC) -c -o $@ $< $(CFLAGS)
%.o: %.cpp
$(CXX) -c -o $@ $< $(CXXFLAGS)
.PHONY: clean
clean:
rm -f $(TARGET) $(OBJS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment