aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-02-22 13:49:08 +0100
committerMattias Andrée <m@maandree.se>2026-02-22 13:49:08 +0100
commit86138fc92d6e5f92d9d3fcceb32b849e8504f619 (patch)
treef361b9cea99dbe4d77d0dd8f9cbc00f67c105d6b /Makefile
parentUdpdate for new version of glibc (diff)
downloadcerberus-86138fc92d6e5f92d9d3fcceb32b849e8504f619.tar.gz
cerberus-86138fc92d6e5f92d9d3fcceb32b849e8504f619.tar.bz2
cerberus-86138fc92d6e5f92d9d3fcceb32b849e8504f619.tar.xz
m fixesHEADmaster
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile57
1 files changed, 23 insertions, 34 deletions
diff --git a/Makefile b/Makefile
index 472f564..2974aa4 100644
--- a/Makefile
+++ b/Makefile
@@ -27,6 +27,9 @@ _LS = $(LOCAL_PREFIX)$(SBIN)
_US = $(USR_PREFIX)$(SBIN)
_SS = $(SBIN)
+TEXI2DVI = texi2dvi
+CC = gcc -std=gnu99
+
AUTH = pam
TTY_GROUP = tty
DEFAULT_HOME = /
@@ -53,21 +56,8 @@ VRB_DEFS = VCS_LEN VCSA_LEN
STR_CPPFLAGS = $(foreach D, $(STR_DEFS), -D'$(D)="$($(D))"')
VRB_CPPFLAGS = $(foreach D, $(VRB_DEFS), -D'$(D)=$($(D))') -DAUTH=$(auth_$(AUTH))
-OPTIMISE = -Os
-STD=gnu99
-WARN = -Wall -Wextra -Wdouble-promotion -Wformat=2 -Winit-self -Wmissing-include-dirs \
- -Wtrampolines -Wfloat-equal -Wshadow -Wmissing-prototypes -Wmissing-declarations \
- -Wredundant-decls -Wnested-externs -Winline -Wno-variadic-macros -Wsync-nand \
- -Wunsafe-loop-optimizations -Wcast-align -Wstrict-overflow -Wdeclaration-after-statement \
- -Wundef -Wbad-function-cast -Wcast-qual -Wwrite-strings -Wlogical-op -Waggregate-return \
- -Wstrict-prototypes -Wold-style-definition -Wpacked -Wvector-operation-performance \
- -Wunsuffixed-float-constants -Wsuggest-attribute=const -Wsuggest-attribute=noreturn \
- -Wsuggest-attribute=pure -Wsuggest-attribute=format -Wnormalized=nfkc -Wconversion \
- -fstrict-aliasing -fstrict-overflow -fipa-pure-const -ftree-vrp -fstack-usage \
- -funsafe-loop-optimizations
-# excluded: -pedantic
CPPFLAGS_ = $(EXTRA_CPP_FLAGS) $(STR_CPPFLAGS) $(VRB_CPPFLAGS)
-CFLAGS_ = -std=$(STD) $(WARN)
+CFLAGS_ = -Os
LDFLAGS_ =
ifneq ($(AUTH),none)
LDFLAGS_ += -lpassphrase
@@ -79,8 +69,8 @@ ifeq ($(AUTH),pam)
LDFLAGS_ += -lpam
endif
-CC_FLAGS = $(CPPFLAGS_) $(CFLAGS_) $(OPTIMISE) $(CPPFLAGS) $(CFLAGS)
-LD_FLAGS = $(LDFLAGS_) $(CFLAGS_) $(OPTIMISE) $(LDFLAGS)
+CC_FLAGS = $(CPPFLAGS_) $(CFLAGS_) $(CPPFLAGS) $(CFLAGS)
+LD_FLAGS = $(LDFLAGS_) $(CFLAGS_) $(LDFLAGS)
SRC = cerberus quit security login
ifneq ($(AUTH),none)
@@ -104,11 +94,11 @@ cerberus: bin/cerberus
bin/cerberus: $(OBJ)
@mkdir -p bin
- $(CC) $(LD_FLAGS) -o "$@" $^
+ $(CC) $(LD_FLAGS) -o "$@" $(OBJ)
obj/cerberus.o: $(foreach H, $(SRC), src/$(H).h) src/auth.h
obj/%.o: src/%.c src/%.h src/config.h
- @mkdir -p "$(shell dirname "$@")"
+ @mkdir -p -- "$$(dirname "$@")"
$(CC) $(CC_FLAGS) -o "$@" -c "$<"
@@ -124,21 +114,21 @@ info: cerberus.info
pdf: cerberus.pdf
%.pdf: info/%.texinfo info/fdl.texinfo
@mkdir -p obj/pdf
- cd obj/pdf ; yes X | texi2pdf ../../$<
+ cd obj/pdf && texi2pdf ../../$< < /dev/null
mv obj/pdf/$@ $@
.PHONY: dvi
dvi: cerberus.dvi
%.dvi: info/%.texinfo info/fdl.texinfo
@mkdir -p obj/dvi
- cd obj/dvi ; yes X | $(TEXI2DVI) ../../$<
+ cd obj/dvi && $(TEXI2DVI) ../../$< < /dev/null
mv obj/dvi/$@ $@
.PHONY: ps
ps: cerberus.ps
%.ps: info/%.texinfo info/fdl.texinfo
@mkdir -p obj/ps
- cd obj/ps ; yes X | texi2pdf --ps ../../$<
+ cd obj/ps && texi2pdf --ps ../../$< < /dev/null
mv obj/ps/$@ $@
@@ -153,36 +143,36 @@ install-base: install-command install-license
.PHONY: install-command
install-command: bin/cerberus
- install -dm755 -- "$(DESTDIR)$(PREFIX)$(INSTALL_BIN)"
- install -m755 -- bin/cerberus "$(DESTDIR)$(PREFIX)$(INSTALL_BIN)/$(COMMAND)"
+ mkdir -p -- "$(DESTDIR)$(PREFIX)$(INSTALL_BIN)"
+ cp -- bin/cerberus "$(DESTDIR)$(PREFIX)$(INSTALL_BIN)/$(COMMAND)"
.PHONY: install-license
install-license:
- install -dm755 -- "$(DESTDIR)$(PREFIX)$(LICENSES)/$(PKGNAME)"
- install -m644 -- COPYING LICENSE "$(DESTDIR)$(PREFIX)$(LICENSES)/$(PKGNAME)"
+ mkdir -p -- "$(DESTDIR)$(PREFIX)$(LICENSES)/$(PKGNAME)"
+ cp -- COPYING LICENSE "$(DESTDIR)$(PREFIX)$(LICENSES)/$(PKGNAME)"
.PHONY: install-doc
install-doc: install-info install-pdf install-ps install-dvi
.PHONY: install-info
install-info: cerberus.info
- install -dm755 -- "$(DESTDIR)$(PREFIX)$(DATA)/info"
- install -m644 -- "$<" "$(DESTDIR)$(PREFIX)$(DATA)/info/$(PKGNAME).info"
+ mkdir -p -- "$(DESTDIR)$(PREFIX)$(DATA)/info"
+ cp -- cerberus.info "$(DESTDIR)$(PREFIX)$(DATA)/info/$(PKGNAME).info"
.PHONY: install-pdf
install-pdf: cerberus.pdf
- install -dm755 -- "$(DESTDIR)$(PREFIX)$(DATA)/doc"
- install -m644 -- "$<" "$(DESTDIR)$(PREFIX)$(DATA)/doc/$(PKGNAME).pdf"
+ mkdir -p -- "$(DESTDIR)$(PREFIX)$(DATA)/doc"
+ cp -- cerberus.pdf "$(DESTDIR)$(PREFIX)$(DATA)/doc/$(PKGNAME).pdf"
.PHONY: install-ps
install-ps: cerberus.ps
- install -dm755 -- "$(DESTDIR)$(PREFIX)$(DATA)/doc"
- install -m644 -- "$<" "$(DESTDIR)$(PREFIX)$(DATA)/doc/$(PKGNAME).ps"
+ mkdir -p -- "$(DESTDIR)$(PREFIX)$(DATA)/doc"
+ cp -- cerberus.ps "$(DESTDIR)$(PREFIX)$(DATA)/doc/$(PKGNAME).ps"
.PHONY: install-dvi
install-dvi: cerberus.dvi
- install -dm755 -- "$(DESTDIR)$(PREFIX)$(DATA)/doc"
- install -m644 -- "$<" "$(DESTDIR)$(PREFIX)$(DATA)/doc/$(PKGNAME).dvi"
+ mkdir -p -- "$(DESTDIR)$(PREFIX)$(DATA)/doc"
+ cp -- cerberus.dvi "$(DESTDIR)$(PREFIX)$(DATA)/doc/$(PKGNAME).dvi"
.PHONY: uninstall
@@ -201,4 +191,3 @@ uninstall:
.PHONY: clean
clean:
-rm -rf -- bin obj cerberus.info cerberus.pdf cerberus.ps cerberus.dvi
-