]> Pileus Git - ~andy/sfvlug/blobdiff - cc/source/makefile
Update C Compiling presentation.
[~andy/sfvlug] / cc / source / makefile
diff --git a/cc/source/makefile b/cc/source/makefile
new file mode 100644 (file)
index 0000000..ce76496
--- /dev/null
@@ -0,0 +1,15 @@
+CC      = gcc
+LD      = ld
+CFLAGS  = -Wall -g -static
+
+default: hello syscall
+
+syscall: syscall.c makefile
+       $(CC) $(CFLAGS) -c -o syscall.o syscall.c
+       $(LD) -static -o syscall syscall.o -lc
+
+hello: %: %.o
+       $(CC) $(CFLAGS) -o $@ $+
+
+%.o: %.c makefile
+       $(CC) $(CFLAGS) -c -o $@ $<