summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2019-01-06 18:38:52 -0500
committermidipix <writeonce@midipix.org>2019-01-09 22:43:14 -0500
commit15500003c2f5d7bd865029a192b2cffaec57a7bf (patch)
treef3dccad849e7ac83012d51d27bb80c486b9c258d
parentbd6d4ffc8524e3c6370599db635e07c0617e37fc (diff)
downloadmmglue-15500003c2f5d7bd865029a192b2cffaec57a7bf.tar.bz2
mmglue-15500003c2f5d7bd865029a192b2cffaec57a7bf.tar.xz
project: fixed dependency logic and generation rule for build/syscall.h.
-rw-r--r--project/config/cfgdefs.in2
-rw-r--r--project/config/cfgdefs.sh4
-rw-r--r--project/headers.mk27
3 files changed, 23 insertions, 10 deletions
diff --git a/project/config/cfgdefs.in b/project/config/cfgdefs.in
index a846390..ef94670 100644
--- a/project/config/cfgdefs.in
+++ b/project/config/cfgdefs.in
@@ -8,5 +8,5 @@ LIBC_MICRO = @libc_micro@
PORT_DIR = @port_dir@
# syscall.h
-syscall-arch: @libc_syscall_arch@
+build/syscall_h.tag: build/@libc_syscall_arch@
diff --git a/project/config/cfgdefs.sh b/project/config/cfgdefs.sh
index 02e54b1..3a2965e 100644
--- a/project/config/cfgdefs.sh
+++ b/project/config/cfgdefs.sh
@@ -71,9 +71,9 @@ cfgdefs_set_libc_options()
fi
if [ -f $arch_dir/arch/$mb_arch/bits/syscall.h.in ]; then
- libc_syscall_arch='syscall-gen'
+ libc_syscall_arch='syscall-gen.tag'
else
- libc_syscall_arch='syscall-copy'
+ libc_syscall_arch='syscall-copy.tag'
fi
}
diff --git a/project/headers.mk b/project/headers.mk
index 14fbfbc..0c3f9a4 100644
--- a/project/headers.mk
+++ b/project/headers.mk
@@ -23,17 +23,23 @@ $(ALLTYPES_H): $(ALLTYPES_DEPS) build/include/bits/
$(PORT_DIR)/arch/$(ARCH)/bits/alltypes.h.in \
$(SOURCE_DIR)/include/alltypes.h.in > $@
-syscall-copy: | build/include/bits/
-syscall-copy: $(PORT_DIR)/arch/$(ARCH)/bits/syscall.h
+build/syscall_h.tag:
+ touch $@
+ touch $(SYSCALL_H)
+
+build/syscall-copy.tag: $(PORT_DIR)/arch/$(ARCH)/bits/syscall.h
+ mkdir -p build/include/bits/
cp $< $(SYSCALL_H)
+ touch $@
-syscall-gen: | build/include/bits/
-syscall-gen: $(PORT_DIR)/arch/$(ARCH)/bits/syscall.h.in
+build/syscall-gen.tag: $(PORT_DIR)/arch/$(ARCH)/bits/syscall.h.in
+ mkdir -p build/include/bits/
cp $< $(SYSCALL_H).tmp
sed -n -e 's/__NR_/SYS_/p' < $< >> $(SYSCALL_H).tmp
mv $(SYSCALL_H).tmp $(SYSCALL_H)
+ touch $@
-$(SYSCALL_H): syscall-arch
+$(SYSCALL_H): build/syscall_h.tag
# arch headers
@@ -83,9 +89,9 @@ $(DESTDIR)$(INCLUDEDIR)/%.h: $(SOURCE_DIR)/include/%.h
chmod 0644 $@.tmp
mv $@.tmp $@
-install-arch-headers: build/headers.tag $(src_bits_h) $(dst_bits_h)
+install-arch-headers: headers.tag $(src_bits_h) $(dst_bits_h)
-install-libc-headers: $(dst_header_dirs) $(dst_c_headers)
+install-libc-headers: headers.tag $(dst_header_dirs) $(dst_c_headers)
install-headers: install-arch-headers install-libc-headers
@@ -96,6 +102,9 @@ build/headers.tag: $(ARCH_HEADERS)
cp $(ARCH_HEADERS) build/include/bits/
touch $@
+headers.tag: build/headers.tag $(ARCH_GEN_H)
+ touch $@
+
clean-headers:
rm -f $(src_bits_h)
rm -f $(SYSCALL_H).tmp
@@ -103,6 +112,10 @@ clean-headers:
rmdir build/include/bits 2>/dev/null || true
rmdir build/include 2>/dev/null || true
rm -f build/headers.tag
+ rm -f build/syscall-copy.tag
+ rm -f build/syscall-gen.tag
+ rm -f build/syscall_h.tag
+ rm -f headers.tag
clean: clean-headers