1 # SPDX-License-Identifier: GPL-2.0
4 INSTALL_PROGRAM ?= $(INSTALL)
5 INSTALL_DATA ?= $(INSTALL) -m 644
10 dss_objects := dss.o str.o file.o exec.o sig.o daemon.o df.o tv.o snap.o ipc.o dss.lsg.o
14 DSS_CPPFLAGS := -DVERSION_STRING='"$(VERSION_STRING)"'
15 DSS_CPPFLAGS += -Wunused-macros
17 DSS_CFLAGS := -Wno-sign-compare -g -Wunused -Wundef
18 DSS_CFLAGS += -Wredundant-decls
21 DSS_CFLAGS += -Wuninitialized
22 DSS_CFLAGS += -Wchar-subscripts
23 DSS_CFLAGS += -Wformat-security
24 DSS_CFLAGS += -Werror-implicit-function-declaration
25 DSS_CFLAGS += -Wmissing-format-attribute
26 DSS_CFLAGS += -Wunused-parameter
27 DSS_CFLAGS += -Wbad-function-cast
28 DSS_CFLAGS += -Wshadow
30 Makefile.deps: $(wildcard *.c *.h)
31 $(CC) -MM -MG $(DSS_CPPFLAGS) $(CPPFLAGS) $(DSS_CFLAGS) $(CFLAGS) *.c > $@
33 -include Makefile.deps
36 $(CC) -o $@ $(dss_objects) $(LDFLAGS) -llopsub
39 $(CC) -c $(DSS_CPPFLAGS) $(CPPFLAGS) $(DSS_CFLAGS) $(CFLAGS) $<
42 lopsubgen --gen-h=$@ < $<
44 lopsubgen --gen-c=$@ < $<
46 lopsubgen --gen-man=$@ --version-string=$(VERSION_STRING) < $<
49 groff -m man -Thtml -P -l -P -r $< | sed -e '1,/^<body>/d; /^<\/body>/,$$d' > $@
52 rm -f *.o dss dss.1 dss.1.html Makefile.deps *~ index.html dss.lsg.h dss.lsg.c
54 ifneq ($(findstring strip, $(MAKECMDGOALS)),)
57 bindir := $(DESTDIR)$(PREFIX)/bin
58 mandir := $(DESTDIR)$(PREFIX)/share/man/man1
59 install install-strip: all
60 $(MKDIR_P) $(bindir) $(mandir)
61 $(INSTALL_PROGRAM) $(strip_option) dss $(bindir)
62 $(INSTALL_DATA) dss.1 $(mandir)
64 index.html: dss.1.html index.html.in INSTALL README NEWS
65 sed -e '/@README@/,$$d' index.html.in > $@
67 sed -e '1,/@README@/d' -e '/@NEWS@/,$$d' index.html.in >> $@
69 sed -e '1,/@NEWS@/d' -e '/@INSTALL@/,$$d' index.html.in >> $@
70 markdown INSTALL >> $@
71 sed -e '1,/@INSTALL@/d' -e '/@MAN_PAGE@/,$$d' index.html.in >> $@
73 sed -e '1,/@MAN_PAGE@/d' index.html.in >> $@