aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Makefile24
1 files changed, 22 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 1d032bc..3631779 100644
--- a/Makefile
+++ b/Makefile
@@ -3,10 +3,27 @@
CONFIGFILE = config.mk
include $(CONFIGFILE)
+OBJ =\
+ consts.o\
+ memory.o\
+ print.o\
+ process.o\
+ sctrace.o\
+ util.o
+
+HDR =\
+ arg.h\
+ common.h\
+ list-errnos.h
+
all: sctrace
+$(OBJ): $(@:.o=.c) $(HDR)
+
+sctrace: $(OBJ)
+ $(CC) -o $@ $(OBJ) $(LDFLAGS)
-sctrace: sctrace.c arg.h list-errnos.h
- $(CC) -o $@ $@.c $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
+.c.o:
+ $(CC) -c -o $@ $< $(CPPFLAGS) $(CFLAGS)
list-errnos.h:
printf '#define LIST_ERRNOS(_)\\\n\t' > $@
@@ -25,4 +42,7 @@ uninstall:
clean:
-rm -f -- *.o list-errnos.h sctrace
+.SUFFIXES:
+.SUFFIXES: .c .o
+
.PHONY: all install uninstall clean