Permalink
Browse files

more Makefile targets

  • Loading branch information...
1 parent 91b4671 commit 0cb73991fe7a44c3f92bdeb6eba44b20e8011b73 @tj committed May 8, 2011
Showing with 15 additions and 4 deletions.
  1. +1 −2 .gitignore
  2. +14 −2 Makefile
View
3 .gitignore
@@ -1,4 +1,3 @@
.DS_Store
-node_modules
-*.sock
bin
+*.o
View
16 Makefile
@@ -1,8 +1,20 @@
+CC ?= gcc
+
SRC = src/cdescent.c \
src/compile.c \
src/tree.c
-bin/cdescent:
+OBJ = $(SRC:.c=.o)
+
+bin/cdescent: $(OBJ)
@mkdir -p bin
- $(CC) -03 $(SRC) -o $@
+ $(CC) -03 $^ -o $@
+
+%.o: %.c
+ $(CC) $< -c -o $@
+
+clean:
+ rm -fr bin src/*.o
+
+.PHONY: clean

0 comments on commit 0cb7399

Please sign in to comment.