Skip to content

Commit 1f5ef8e

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

File tree

11 files changed

+20
-8
lines changed

11 files changed

+20
-8
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_conf/conf_file.c

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

19+
#define _GNU_SOURCE
20+
1921
#include "conf_file.h"
2022
#include "dns_conf_group.h"
2123
#include "set_file.h"

src/dns_conf/set_file.c

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

19+
#define _GNU_SOURCE
20+
1921
#include "set_file.h"
2022
#include "smartdns/lib/idna.h"
2123
#include "smartdns/lib/stringutil.h"

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"

src/lib/radix.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
5656
*/
5757

58+
#define _GNU_SOURCE
59+
5860
#include <sys/types.h>
5961
#include <stdlib.h>
6062
#include <stdio.h>

src/lib/timer_wheel.c

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

19+
#define _GNU_SOURCE
20+
1921
#include "smartdns/lib/bitops.h"
2022
#include <pthread.h>
2123
#include <stdio.h>

src/utils/daemon.c

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

19+
#define _GNU_SOURCE
20+
1921
#include "smartdns/util.h"
2022

2123
#include <dirent.h>

src/utils/misc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* You should have received a copy of the GNU General Public License
1616
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1717
*/
18+
#define _GNU_SOURCE
1819

1920
#include "smartdns/dns.h"
2021
#include "smartdns/util.h"

src/utils/net.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* You should have received a copy of the GNU General Public License
1616
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1717
*/
18+
#define _GNU_SOURCE
1819

1920
#include "smartdns/dns.h"
2021
#include "smartdns/lib/jhash.h"

0 commit comments

Comments
 (0)