c-exercises/Makefile

52 lines
1.2 KiB
Makefile
Raw Normal View History

2013-05-11 21:01:39 +02:00
CFLAGS=-std=c99 -Wall -g -O2
2013-05-09 19:18:10 +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
2013-08-02 19:04:57 +02:00
EXTRAS=mandelbrot.bmp multibrot.png test-inline-assembly.s
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-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 $@ $<
uiowa-threads-example: uiowa-threads.o uiowa-threads-example.c
$(CC) $(CFLAGS) -o $@ $^