Makefile 811 B

123456789101112131415161718192021222324252627282930
  1. CC = g++
  2. # sana: explanations about CFLAGS values
  3. # -Llib/ ==> gcc searches for pngwriter library into lib/ directory
  4. # -I lib/ and /usr/include/freetype2/ ==> gcc searches for needed headers into those directories
  5. CFLAGS = -Wall -ltemelia -lm -O2
  6. # Test sources folder
  7. SRCDIR = src
  8. # Object files
  9. OBJS = $(shell ls $(SRCDIR)/*.cpp|tr '\n' ' '|sed -n -e s/\\.cpp/.o/gp)
  10. PERFORMANCE_BIN = temelia_performance
  11. # build an executable capable of hard testing data structures
  12. all: $(PERFORMANCE_BIN)
  13. # build the performance tests, must have built the objects first
  14. $(PERFORMANCE_BIN): $(OBJS)
  15. $(CC) $(OBJS) $(CFLAGS) -o $(PERFORMANCE_BIN)
  16. # given an object ($@) that has a corresponding C source ($<), build it
  17. .cpp.o:
  18. $(CC) $(CFLAGS) -c "$<" -o "$@"
  19. .PHONY: clean
  20. clean:
  21. -rm $(PERFORMANCE_BIN) $(OBJS)