summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile11
-rw-r--r--src/as/Makefile3
-rw-r--r--src/c/Makefile6
3 files changed, 17 insertions, 3 deletions
diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 0000000..91c565b
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,11 @@
+.PHONY: all build_as build_c
+
+all: build_as build_c
+
+build_as:
+ $(MKDIR) $(AS_OBJECT_DIR)
+ @$(MAKE) --directory as
+
+build_c:
+ $(MKDIR) $(C_OBJECT_DIR)
+ @$(MAKE) --directory c
diff --git a/src/as/Makefile b/src/as/Makefile
index bd5664b..c8919d7 100644
--- a/src/as/Makefile
+++ b/src/as/Makefile
@@ -1,5 +1,6 @@
.PHONY: all
+
all: $(AS_OBJECTS)
-$(AS_OBJECT_DIR)/%.o: %.s
+$(AS_OBJECT_DIR)/%.o: %.s Makefile
$(AS) $< -o $@
diff --git a/src/c/Makefile b/src/c/Makefile
index 9ee253d..b8fe609 100644
--- a/src/c/Makefile
+++ b/src/c/Makefile
@@ -1,6 +1,8 @@
.PHONY: all
+
all: $(C_OBJECTS)
+$(C_OBJECT_DIR)/%.o: %.c Makefile
+ $(CC) $(CFLAGS) -MD -MP -c $< -o $@
-$(C_OBJECT_DIR)/%.o: %.c
- $(CC) $(CFLAGS) -c $< -o $@
+-include $(C_OBJECTS:.o=.d)