2 Commits

Author SHA1 Message Date
a8e2a9349e Exit with appropriate return code if password is not provided, fixes #87 2024-11-07 21:39:37 +02:00
deed43ad61 Makefile macOS fix, resolves #82, resolves #102
- Remove "ginstall" as "install" replacement on macOS
- Remove "-D" flag from "install" parameters
2024-11-07 17:14:25 +02:00
3 changed files with 5 additions and 10 deletions

View File

@ -1,5 +1,5 @@
Building and installing
------------------------
-----------------------
Only dependency is C library and POSIX getopt support.

View File

@ -4,7 +4,7 @@
# make
#
# Windows cross compile:
# i686-w64-mingw32-gcc -std=gnu99 -Wall -Wextra -Wpedantic -O2 -o mcrcon.exe mcrcon.c -lws2_32
# x86_64-w64-mingw32-gcc -std=gnu99 -Wall -Wextra -Wpedantic -O2 -fstack-protector-all -o mcrcon.exe mcrcon.c -lws2_32
EXENAME = mcrcon
PREFIX ?= /usr/local
@ -23,11 +23,6 @@ ifeq ($(OS), Windows_NT)
RM = cmd /C del /F
endif
ifeq ($(shell uname), Darwin)
INSTALL = ginstall
CFLAGS = -std=gnu99 -Wall -Wextra -Wpedantic -O2
endif
.PHONY: all
all: $(EXENAME)
@ -37,8 +32,8 @@ $(EXENAME): mcrcon.c
ifneq ($(OS), Windows_NT)
.PHONY: install
install:
$(INSTALL) -vD $(EXENAME) $(DESTDIR)$(PREFIX)/bin/$(EXENAME)
$(INSTALL) -vD -m 0644 mcrcon.1 $(DESTDIR)$(PREFIX)/share/man/man1/mcrcon.1
$(INSTALL) -v $(EXENAME) $(DESTDIR)$(PREFIX)/bin/$(EXENAME)
$(INSTALL) -v -m 0644 mcrcon.1 $(DESTDIR)$(PREFIX)/share/man/man1/mcrcon.1
@echo "\nmcrcon installed. Run 'make uninstall' if you want to uninstall.\n"
.PHONY: uninstall

View File

@ -209,7 +209,7 @@ int main(int argc, char *argv[])
if (pass == NULL) {
puts("You must give password (-p password).\nTry 'mcrcon -h' or 'man mcrcon' for help.");
return 0;
exit(EXIT_FAILURE);
}
if(optind == argc && terminal_mode == 0)