Browse code

Add Makefile.

Xavier G authored on 23/08/2016 03:31:54
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,23 @@
1
+# All *sort.c files result in a *sort program, and optionally a *sort.s
2
+# assembly listing.
3
+SRCS = $(wildcard *sort.c)
4
+PROGS = $(patsubst %.c,%,$(SRCS))
5
+ASMS =  $(patsubst %.c,%.s,$(SRCS))
6
+
7
+CC=gcc
8
+RM=rm -f
9
+CFLAGS=-Wall -g
10
+
11
+
12
+all: $(PROGS)
13
+
14
+asm: $(ASMS)
15
+
16
+clean:
17
+	$(RM) $(PROGS) ${ASMS}
18
+
19
+%sort: %sort.c common.c
20
+	$(CC) $(CFLAGS) -o $@ $<
21
+
22
+%sort.s: %sort.c common.c
23
+	${CC} ${CFLAGS} -S -o $@ $<