Skip to content

Instantly share code, notes, and snippets.

@Temaruk
Created September 28, 2012 10:16
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 Temaruk/3799013 to your computer and use it in GitHub Desktop.
Save Temaruk/3799013 to your computer and use it in GitHub Desktop.
Computer Graphics course, University of Szeged - Example makefile, multi-OS
# Makefile for Phigs examples
OS = $(shell uname -s)
APPS = application_name
OBJ = $(APPS).o
SRC = $(APPS).c
CFLAGS = $(C_OPTS) -I/usr/include
ifeq ($(OS), Darwin)
LIBS = -framework GLUT -framework OpenGL -framework Cocoa
else
LIBS = -L/usr/X11R6/lib -lX11 -lXi -lglut -lGL -lGLU -lm -lpthread
endif
application:$(APPS)
clean:
rm -f $(APPS) *.raw *.o core a.out
realclean: clean
rm -f *~ *.bak *.BAK
.SUFFIXES: c o
.c.o:
$(CC) -c $(CFLAGS) $<
$(APPS): $(OBJ)
$(CC) -o $(APPS) $(CFLAGS) $(OBJ) $(LIBS)
depend:
makedepend -- $(CFLAGS) $(SRC)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment