-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makedefs
executable file
·43 lines (37 loc) · 1 KB
/
Makedefs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
MAKE = make
AR = @ar
CC = @g++
MV = @mv
RM = @rm -rf
MKDIR = @mkdir
MKDEP = @mkdep
ECHO = @echo
INCDIRS = -I/usr/X11R6/include
#use the following LIBS line for GNU/Linux
#LIBS = -lm -lX11 -lXmu -lXi -lXext -lGL -lGLU -lglut
#use this one instead for Mac OSX
LIBS = -lm -framework GLUT -lobjc -framework OpenGL
LIBDIRS = -L. -L/usr/lib
LDFLAGS = -O3 $(LIBDIRS) $(LIBS)
CFLAGS = $(INCDIRS) -O3 -fomit-frame-pointer \
-Wno-deprecated -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
.SUFFIXES: .cpp .h .d .o
.cpp.o:
$(ECHO) "Compiling $<"
$(CC) $(CFLAGS) -c -o $@ $<
.d.o:
$(ECHO) "Finding dependancies for $<"
$(CC) $(CFLAGS) -MD -E $<
SOURCES = $(wildcard *.cpp)
OBJS = $(patsubst %.cpp, %.o, $(SOURCES))
DEPS = $(patsubst %.cpp, %.d, $(SOURCES))
clean:
$(RM) core .deps *.o $(NAME)
$(RM) lexer.cpp parse.cpp parse.cpp.h
$(ECHO) "All clean!"
deps:
$(ECHO) "Finding dependancies in `pwd`..."
$(RM) .deps
$(CC) $(CFLAGS) -MD -E $(SOURCES) > /dev/null
$(MKDIR) .deps
$(MV) $(DEPS) .deps