File: build-stamp.patch

package info (click to toggle)
mbuffer 20230301%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,096 kB
  • sloc: ansic: 4,321; sh: 3,418; makefile: 160
file content (32 lines) | stat: -rw-r--r-- 898 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Description: Fix the build file and directory dependencies.
 Create a build/created.stamp file and depend on it instead of
 the build/ directory itself when checking for stale object and
 executable files. This fixes a problem with make(1) considering
 everything as out of date since the build/ directory's timestamp
 has been updated after the object files within it.
Forwarded: no
Author: Peter Pentchev <roam@ringlet.net>
Last-Update: 2020-10-14

--- a/Makefile.in
+++ b/Makefile.in
@@ -53,8 +53,9 @@
 
 $(OBJECTS): config.h Makefile
 
-build:
-	mkdir build
+build/created.stamp:
+	[ -d build ] || mkdir build
+	touch build/created.stamp
 
 build/%.o: %.c
 	$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
@@ -196,6 +197,6 @@
 idev.so: idev.c config.h
 	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -g -fPIC idev.c -o $@ $(LIBS)
 
-$(DEPS): | build
+$(DEPS): | build/created.stamp
 
 include $(DEPS)