# # Sample Makefile # # USAGE: # 1. Replace the a.c b.c with your source files (.c, cpp only) # 2. replace myproj with the name of the executable. # 3. In the first time and every time you add a #include statement # in your program, type "make depend" # 4. To build the program, type make. # LIBS = -lGnomeGR -lglut -lGL -lGLU -lm CC = gcc CFLAGS = -O -Wall LIBRARIAN = ar LIBFLAGS = r LDFLAGS=-L . SOURCES = gnomegr.c OBJECTS := $(patsubst %.c,%.o,$(SOURCES)) TESTSOURCES = testgngr.c TESTOBJECTS := $(patsubst %.c,%.o,$(TESTSOURCES)) .c.o: $(CC) -c $(CFLAGS) $< all: libGnomeGR.a gngrtest libGnomeGR.a: $(OBJECTS) $(LIBRARIAN) r $@ $^ gngrtest: $(TESTOBJECTS) $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) clean: $(RM) *.o *~ depend: $(CC) -M $(SOURCES) > .depend -include .depend