Makefile
changeset 0 af501b0c1716
child 2 97beb75e5ac7
new file mode 100644
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,182 @@
+CC=gcc -g -ggdb
+CFLAGS=-Wall -O2 -Iinclude -ansi
+NASM=nasm -f elf -Iinclude/
+TARGET=ncurses \
+	numerierung \
+	xdemo \
+	signals \
+	tree \
+	utf8 \
+	file_demo \
+	testcase \
+	atoi_print \
+	data_types \
+	dnsresolve \
+	nomalloc \
+	urandom \
+	threads \
+	crypt \
+	tokenpasting \
+	hex2chars \
+	floating \
+	max \
+	recording \
+	endian \
+	fak \
+	blackhole \
+	folge \
+	counter \
+	sudoku \
+	cunit \
+	md5 \
+	varargs \
+	concatenation \
+	alpha_beta \
+	life
+
+.SUFFIXES: .c .asm
+
+.c.o:
+	@echo Compiling $< ...
+	@$(CC) -c $(CFLAGS) -o $@ $<
+
+.asm.o:
+	@echo Assembling $< ...
+	@$(NASM) $< -o $@
+
+all: $(TARGET)
+
+ncurses: ncurses.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -lncursesw -o $@ $<
+
+numerierung: numerierung.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -o $@ $<
+
+xdemo: xdemo.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -lX11 -o $@ $<
+
+signals: signals.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -o $@ $<
+
+tree: tree.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -o $@ $<
+
+utf8: utf8.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -o $@ $<
+
+file_demo: file_demo.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -o $@ $<
+
+testcase: testcase.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -o $@ $<
+
+atoi_print: atoi_print.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -o $@ $<
+
+data_types: data_types.c
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -std=c99 -o $@ $<
+
+dnsresolve: dnsresolve.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -o $@ $<
+
+nomalloc: nomalloc.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -o $@ $<
+
+urandom: urandom.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -o $@ $<
+
+threads: threads.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -o $@ $< -lpthread
+
+crypt: crypt.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -o $@ $<
+
+tokenpasting: tokenpasting.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -o $@ $<
+
+hex2chars: hex2chars.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -o $@ $< -lm
+
+floating: floating.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -o $@ $< -lm
+
+max: max.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -o $@ $<
+
+recording: recording.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -o $@ $<
+
+endian: endian.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -o $@ $<
+
+fak: fak.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -o $@ $<
+
+blackhole: blackhole.c
+	@echo Compiling AND Linking $< WITH -O0 ...
+	@$(CC) $(CFLAGS) -O0 -o $@ $<
+
+folge: folge.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -o $@ $< -lm
+
+counter: counter.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -o $@ $<
+
+sudoku: sudoku.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -o $@ $<
+
+cunit: cunit.o
+	@echo Linking $< ...
+	@$(CC) $(CFLAGS) -o $@ $< -lcunit
+
+md5: md5.o
+	@echo Linking $< ...
+	@$(CC) -o $@ $< -llsf
+
+varargs: varargs.o
+	@echo Linking $< ...
+	@$(CC) -o $@ $<
+
+concatenation: concatenation.o
+	@echo Linking $< ...
+	@$(CC) -o $@ $<
+
+alpha_beta: alpha_beta.o
+	@echo Linking $< ...
+	@$(CC) -o $@ $<
+
+life: life.c
+	@echo Linking $< ...
+	@$(CC) -o $@ $<
+
+.PHONY: clean uninstall
+
+clean:
+	rm -f *.o *~
+	rm -f $(TARGET)
+