fixed build with gcc-12.1.1
[hatexmpp.git] / Makefile
blobc4fe06d33dad857fe6baea3da92b3fd41ef232a5
1 CFLAGS+=-std=gnu99
2 ifdef DEBUG
3 CFLAGS+=-ggdb3 -DDEBUG -Og -Wall -pedantic
4 else
5 CFLAGS+=-DNDEBUG
6 endif
8 EXE=hatexmpp
9 CFLAGS+=$(shell pkg-config fuse loudmouth-1.0 --cflags)
10 LDLIBS:=$(shell pkg-config fuse loudmouth-1.0 --libs)
12 all: main-build
14 main-build: astyle
15 $(MAKE) --no-print-directory $(EXE)
17 SRCS := $(wildcard *.c) version.c
18 OBJS := $(SRCS:%.c=%.o)
20 $(EXE): $(OBJS)
22 .PHONY: clean astyle
24 CPPFLAGS += -MMD
25 -include $(SRCS:.c=.d)
27 version.c:
28 echo "char HateXMPP_ver[] = "\"0.2-`git log --no-show-signature -n1 --pretty=format:%H`\""; char * getversion(void) { return HateXMPP_ver; }" > version.c
30 .PHONY: clean astyle
32 clean:
33 rm -rf *.o *.d version.c $(EXE)
35 install: $(EXE)
36 install $(EXE) $(DESTDIR)/usr/bin
38 astyle:
39 astyle --style=linux --indent=tab --unpad-paren --pad-header --pad-oper *.c *.h