c-exercises/Makefile

78 lines
2 KiB
Makefile
Raw Normal View History

2014-02-14 21:35:28 +01:00
CC=clang
2013-05-09 19:18:10 +02:00
2013-12-10 21:57:45 +01:00
CFLAGS=-std=c99 -Wextra -pedantic -g -O0
2014-04-12 13:12:55 +02:00
CC_OPENMP=gcc # no OpenMP in our clang
CFLAGS_OPENMP=$(CFLAGS) -fopenmp
2014-04-12 15:13:15 +02:00
TARGETS=approximate-pi linked-list mandelbrot threads circular-buffer structs ncurses-pong bit-fuckery bit-fuckery2 checkcheck multibrot bloom wo-lernen lua-foo binsearch test-inline-assembly uiowa-threads-example mtrace-test av-variance undefined-behaviour multibrot-openmp hello-openmp mandelbrot-openmp
2013-12-10 21:57:45 +01:00
EXTRAS=mandelbrot.bmp multibrot.png test-inline-assembly.s tags mtrace-test.trace mtrace-test.txt
2013-05-17 06:39:04 +02:00
2013-05-11 13:10:00 +02:00
.PHONY: all
2013-06-16 14:10:10 +02:00
all: $(TARGETS) $(EXTRAS)
2013-05-10 14:32:21 +02:00
2013-05-11 13:10:00 +02:00
.PHONY: clean
2013-05-10 14:32:21 +02:00
clean:
2013-11-28 10:54:20 +01:00
rm -f $(TARGETS) $(EXTRAS) *.o *~ cppcheck.txt
.PHONY: cppcheck
cppcheck: cppcheck.txt
cppcheck.txt: *.c *.h
cppcheck . 2> $@
cat $@
2013-05-09 19:32:02 +02:00
2013-12-08 23:02:39 +01:00
tags: *.c
ctags -R .
2013-05-11 13:10:00 +02:00
mandelbrot: mandelbrot.c
$(CC) $(CFLAGS) $(shell sdl-config --cflags) -o $@ $< $(shell sdl-config --libs) -lm
2013-05-16 20:44:46 +02:00
2013-05-17 06:39:04 +02:00
mandelbrot.bmp: mandelbrot
./mandelbrot
2013-05-16 20:44:46 +02:00
threads: threads.c
$(CC) $(CFLAGS) -o $@ $< -pthread
2013-06-09 20:56:25 +02:00
ncurses-pong: ncurses-pong.c
$(CC) $(CFLAGS) -o $@ $< -lncurses
2013-06-16 10:43:47 +02:00
checkcheck: checkcheck.c
$(CC) $(CFLAGS) -o $@ $< -lcheck
2013-06-16 14:10:10 +02:00
multibrot: multibrot.c
2013-06-16 16:12:08 +02:00
$(CC) $(CFLAGS) -o $@ $< -lm -lpng -pthread
2013-06-16 14:10:10 +02:00
multibrot.png: multibrot
2013-06-16 16:12:08 +02:00
./multibrot -j2
2013-07-05 07:58:15 +02:00
lua-foo: lua-foo.c
$(CC) $(CFLAGS) -o $@ $< -llua -lm
2013-08-02 19:04:57 +02:00
test-inline-assembly: test-inline-assembly.c
$(CC) -Wall -o $@ $<
test-inline-assembly.s: test-inline-assembly.c
$(CC) -Wall -S -o $@ $<
2013-12-10 21:57:45 +01:00
mtrace-test.trace: mtrace-test
MALLOC_TRACE=$@ ./mtrace-test
mtrace-test.txt: mtrace-test.trace
-mtrace mtrace-test mtrace-test.trace > mtrace-test.txt
uiowa-threads-example: uiowa-threads.o uiowa-threads-example.c
$(CC) $(CFLAGS) -o $@ $^
2014-02-14 20:20:32 +01:00
av-variance: av-variance.c
$(CC) $(CFLAGS) -o $@ $< -lm
2014-04-12 13:12:55 +02:00
hello-openmp: hello-openmp.c
$(CC_OPENMP) $(CFLAGS_OPENMP) -o $@ $<
2014-04-12 13:12:55 +02:00
multibrot-openmp: multibrot-openmp.c
$(CC_OPENMP) $(CFLAGS_OPENMP) -o $@ $< -lm -lpng
2014-04-12 15:13:15 +02:00
mandelbrot-openmp: mandelbrot-openmp.c
$(CC_OPENMP) $(CFLAGS_OPENMP) $(shell sdl-config --cflags) -o $@ $< $(shell sdl-config --libs) -lm