about summary refs log tree commit diff
path: root/src/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Makefile b/src/Makefile
index 6b4c792bbbad..2372572758ad 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -2,8 +2,16 @@ all: nix nix-instantiate
 
 SYSTEM = $(shell ./config.guess)
 
-nix: nix.cc
-	g++ -g -Wall -o nix nix.cc -ldb_cxx-4 -DSYSTEM=\"$(SYSTEM)\"
+nix: nix.o md5.o
+	g++ -g -o $@ $^ -ldb_cxx-4
+
+%.o: %.cc
+	g++ -g -Wall -o $@ -c $< -DSYSTEM=\"$(SYSTEM)\"
+
+%.o: %.c
+	gcc -g -Wall -o $@ -c $< -DSYSTEM=\"$(SYSTEM)\"
+
+md5.o: md5.c md5.h
 
 nix-instantiate: nix-instantiate.in
 	sed "s/@SYSTEM@/$(SYSTEM)/" < $^ > $@