summaryrefslogtreecommitdiff
blob: 204d1a5466a74a4f950a345a579c4dd9f23fa9c2 (plain)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From 8e9d059fa88606cba97291232ec16732f552bd48 Mon Sep 17 00:00:00 2001
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
Date: Thu, 25 Nov 2021 14:24:25 +0100
Subject: [PATCH] Makefile: abstract ar to $(AR) and remove tags from all

Build systems need to be able to use a custom `ar` binary. Also, running
ctags is generally not desirable for the default target.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
Sent upstream as: https://github.com/alexpevzner/sane-airscan/pull/197

 Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 4c7e202..415d489 100644
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,7 @@
 #   ----     -------                    -----------
 #   DESTDIR                             Destination directory for make install
 #   CC         gcc                      C compiler
+#   AR         ar                       Archiver
 #   CPPFLAGS                            C preprocessor flags
 #   CFLAGS     -O2 -g -W -Wall -Werror  C compiler flags
 #   LDFLAGS                             Linker flags
@@ -28,6 +29,7 @@
 #
 
 CC		= gcc
+AR		= ar
 COMPRESS 	= gzip -n
 CFLAGS		+= -O2 -g -W -Wall -Werror -pthread $(CPPFLAGS)
 PKG_CONFIG 	= pkg-config
@@ -101,7 +103,7 @@ $(OBJDIR)%.o: %.c Makefile airscan.h
 
 .PHONY: all clean install man
 
-all:	tags $(BACKEND) $(DISCOVER) test test-decode test-multipart test-zeroconf test-uri
+all:	$(BACKEND) $(DISCOVER) test test-decode test-multipart test-zeroconf test-uri
 
 tags: $(SRC) airscan.h test.c test-decode.c test-multipart.c test-zeroconf.c test-uri.c
 	-ctags -R .
@@ -113,7 +115,7 @@ $(DISCOVER): $(OBJDIR)discover.o $(LIBAIRSCAN)
 	 $(CC) -o $(DISCOVER) discover.c $(CPPFLAGS) $(common_CFLAGS) $(LIBAIRSCAN) $(tools_LDFLAGS)
 
 $(LIBAIRSCAN): $(OBJ) Makefile
-	ar cru $(LIBAIRSCAN) $(OBJ)
+	$(AR) cru $(LIBAIRSCAN) $(OBJ)
 
 install: all
 	mkdir -p $(DESTDIR)/$(bindir)
-- 
2.34.1