diff --git a/Makefile b/Makefile index e2552341..3b1d6ac5 100644 --- a/Makefile +++ b/Makefile @@ -115,6 +115,13 @@ clean: (cd $(builddir)test; echo ==== `pwd` ===; $(call sub_make,test,clean)); rm -rf $(builddir)doc/api +lint: + (cd $(builddir)exec; echo ==== `pwd` ===; $(call sub_make,exec,lint)); + (cd $(builddir)services; echo ==== `pwd` ===; $(call sub_make,services,lint)); + (cd $(builddir)lcr; echo ==== `pwd` ===; $(call sub_make,lcr,lint)); + (cd $(builddir)lib; echo ==== `pwd` ===; $(call sub_make,lib,lint)); + (cd $(builddir)tools; echo ==== `pwd` ===; $(call sub_make,tools,lint)); + COROSYNC_LIBS = evs cpg cfg coroutil confdb COROSYNC_HEADERS = cpg.h cfg.h evs.h ipc_gen.h mar_gen.h swab.h \ diff --git a/Makefile.inc b/Makefile.inc index bac0da69..15f5ee56 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -46,6 +46,7 @@ endif CFLAGS = LDFLAGS = DYFLAGS = +LINT_FLAGS = -weak +posixlib +ignoresigns -fcnuse -badflag -D__gnuc_va_list=va_list -D__attribute\(x\)= override CFLAGS += -DLCRSODIR='"$(LCRSODIR)"' diff --git a/exec/Makefile b/exec/Makefile index 307d5ffe..1d138f26 100644 --- a/exec/Makefile +++ b/exec/Makefile @@ -137,6 +137,9 @@ liblogsys.so.2.0.0: $(LIBLOGSYS_OBJS) endif +lint: + -splint $(LINT_FLAGS) $(CFLAGS) *.c + clean: rm -f corosync $(OBJS) *.o *.lcrso libtotem_pg.so* libtotem_pg.a gmon.out rm -f *.da *.bb *.bbg liblogsys.so* liblogsys.a diff --git a/lcr/Makefile b/lcr/Makefile index c263c4b9..6d0375e9 100755 --- a/lcr/Makefile +++ b/lcr/Makefile @@ -84,3 +84,6 @@ clean: rm -f test libtest.so* *.o uic liblcr.so* liblcr.a *.lcrso *.da *.ba *.bb *.bbg \ test_static +lint: + -splint $(LINT_FLAGS) $(CFLAGS) *.c + diff --git a/lib/Makefile b/lib/Makefile index 5836536d..64a1e50e 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -121,6 +121,9 @@ clean: libquorum.so* libquorum.a \ libconfdb.a libconfdb.a \ *.da *.bb *.bbg +lint: + -splint $(LINT_FLAGS) $(CFLAGS) *.c + # -fPIC rules required for all libraries %.o: %.c $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $< diff --git a/services/Makefile b/services/Makefile index 1b323fa9..9a586faa 100644 --- a/services/Makefile +++ b/services/Makefile @@ -96,6 +96,9 @@ endif clean: rm -f *.o *.lcrso +lint: + -splint $(LINT_FLAGS) $(CFLAGS) *.c + depend: makedepend -Y -- $(CFLAGS) $(CPPFLAGS) $(EXEC_SRC) $(TOTEM_SRC) $(LOGSYS_SRC) $(LCR_SRC) > /dev/null 2>&1 diff --git a/tools/Makefile b/tools/Makefile index ae788a56..82888f39 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -66,6 +66,9 @@ corosync-pload: corosync-pload.o clean: rm -f *.o $(BINARIES) +lint: + -splint $(LINT_FLAGS) $(CFLAGS) *.c + %.o: %.c $(CC) $(CFLAGS) $(CPPFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<