Skip to content

Commit 1995ee3

Browse files
committed
makefile: fix clang-tidy missing file issue.
1 parent 92bee44 commit 1995ee3

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
BIN=smartdns
1818
SMARTDNS_LIB=libsmartdns.a
1919
SMARTDNS_TEST_LIB=libsmartdns-test.a
20-
OBJS_LIB=$(patsubst %.c,%.o,$(wildcard *.c)) $(patsubst %.c,%.o,$(wildcard */*.c))
21-
OBJS_MAIN=$(filter-out main.o, $(patsubst %.c,%.o,$(wildcard *.c)))
22-
TEST_OBJS=$(patsubst %.o,%_test.o,$(OBJS_MAIN) $(OBJS_LIB))
20+
# libs without main.o
21+
OBJS=$(filter-out main.o, $(patsubst %.c,%.o,$(wildcard *.c)) $(patsubst %.c,%.o,$(wildcard */*.c)))
22+
# libs without lib/%.o
23+
LINT_OBJS=$(filter-out lib/%.o, $(OBJS))
24+
TEST_OBJS=$(patsubst %.o,%_test.o,$(OBJS))
2325
MAIN_OBJ = main.o
24-
OBJS=$(OBJS_MAIN) $(OBJS_LIB)
2526

2627
# cflags
2728
ifndef CFLAGS
@@ -93,7 +94,7 @@ $(SMARTDNS_LIB): $(OBJS)
9394
$(AR) rcs $@ $^
9495

9596
clang-tidy:
96-
clang-tidy -p=. $(OBJS_MAIN:.o=.c) -- $(CFLAGS)
97+
clang-tidy -p=. $(LINT_OBJS:.o=.c) -- $(CFLAGS)
9798

9899
clean:
99100
$(RM) $(OBJS) $(BIN) $(SMARTDNS_LIB) $(MAIN_OBJ) $(SMARTDNS_TEST_LIB) $(TEST_OBJS)

src/dns_server/cname.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "cname.h"
2020
#include "request.h"
2121
#include "rules.h"
22-
#include "request.h"
2322

2423
static DNS_CHILD_POST_RESULT _dns_server_process_cname_callback(struct dns_request *request,
2524
struct dns_request *child_request, int is_first_resp)

src/dns_server/dualstack.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1717
*/
1818

19-
#include "dualstack.h"
2019
#include "dns_server.h"
2120
#include "dualstack.h"
2221
#include "request.h"

0 commit comments

Comments
 (0)