Makefile 632 B

1234567891011121314151617181920212223
  1. CC=/usr/bin/gcc
  2. CFLAGS=-g -Werror -D _DEFAULT_SOURCE -O0 -D_XOPEN_SOURCE=600 -pthread -pedantic -pedantic-errors -fno-fast-math -fno-builtin -m64 -std=iso9899:1999 -I${PWD} -I${PWD}/../libpng
  3. OUT=bin
  4. OBJ=$(OUT)/obj
  5. OBJS=$(OBJ)/mandelbrot.o $(OBJ)/img.o
  6. all: pre bin/mandelbrot
  7. bin/mandelbrot: $(OBJS)
  8. $(CC) $(CFLAGS) $(OBJS) -o $(OUT)/mandelbrot -lpng -pthread
  9. bin/obj/mandelbrot.o: mandelbrot.c config.h
  10. $(CC) $(CFLAGS) -c mandelbrot.c -o $(OBJ)/mandelbrot.o -pthread
  11. bin/obj/img.o: ../libpng/img.c
  12. $(CC) $(CFLAGS) -c ../libpng/img.c -o $(OBJ)/img.o -lpng
  13. pre:
  14. mkdir -p bin/obj
  15. clean:
  16. find ./bin -type f -exec rm {} \;