More fixes for make install

This commit is contained in:
Andrew Pamment 2018-10-26 14:20:45 +10:00
parent f26e31c660
commit 63438cea6d
4 changed files with 16 additions and 9 deletions

View File

@ -18,10 +18,10 @@ all: magicka
.PHONY: magicka www clean cleanwww install
magicka:
cd src && $(MAKE) -f GNUmakefile.debian
cd src && $(MAKE) -f GNUmakefile.debian MAGIEDIT_ANSI_PATH="$(datarootdir)/magicka/ansis/" MAGIEDIT_DRAFT_PATH="$(datarootdir)/magicka/ansis/"
www:
cd src && $(MAKE) -f GNUmakefile.debian www
cd src && $(MAKE) -f GNUmakefile.debian MAGIEDIT_ANSI_PATH="$(datarootdir)/magicka/ansis/" MAGIEDIT_DRAFT_PATH="$(datarootdir)/magicka/ansis/" www
clean:
cd src && $(MAKE) -f GNUmakefile.debian clean
@ -141,3 +141,12 @@ install:
install -m644 dist/menus/file.mnu ${DESTDIR}${datarootdir}/magicka/menus/file.mnu
install -m644 dist/menus/logoff.mnu ${DESTDIR}${datarootdir}/magicka/menus/logoff.mnu
install -m644 dist/menus/mail.mnu ${DESTDIR}${datarootdir}/magicka/menus/mail.mnu
echo "You should now create a user to run magicka"
echo "and assuming that user is magicka:
echo " "
echo " chown -R magicka:magicka ${datarootdir}/magicka/scripts/data"
echo " chown -R magicka:magicka ${localstatedir}/magicka"
echo " "
echo "Then configure ${sysconfdir}/magicka/bbs.ini to your liking"

View File

@ -1,5 +1,5 @@
CC:= cc
CFLAGS:= -std=gnu99 -I/usr/local/include -ggdb
CFLAGS:= -std=gnu99 -I/usr/local/include
LIBS:= -L/usr/local/lib -lsqlite3 -lutil -lm -ldl -lssl -lcrypto -lssh -lmosquitto
EXTRAOBJS:= strlcpy/strlcpy.o strlcpy/strlcat.o
@ -8,7 +8,4 @@ LIBTOOLIZE:= libtoolize
DEPS_LUA_TARGET:= linux
DEPS_JAMLIB_MAKEFILE:= Makefile.linux
MAGIEDIT_ANSI_PATH:= "$(datarootdir)/magicka/ansis/"
MAGIEDIT_DRAFT_PATH:= "$(localstatedir)/magicka/"
include GNUmakefile.common

View File

@ -1,9 +1,10 @@
CC=cc
CFLAGS=-I../../deps/odoors/
CFLAGS=-I../../deps/odoors/ -DANSI_PATH="\"$(ANSI_PATH)\"" -DDRAFT_PATH="\"$(DRAFT_PATH)\""
DEPS = main.c
OS = $(shell uname -s)
ODOORS = ../../deps/odoors/libs-${OS}/libODoors.a
ifeq ($(OS), SunOS)
EXTRA_LIBS = -lsocket
endif

View File

@ -451,7 +451,7 @@ char *message_editor() {
}
// write
snprintf(draft_path, PATH_MAX, "drafts/%s/%s.draft", od_control_get()->user_name, draft_filename);
snprintf(draft_path, PATH_MAX, DRAFT_PATH "drafts/%s/%s.draft", od_control_get()->user_name, draft_filename);
fptr = fopen(draft_path, "w");
if (!fptr) {
@ -501,7 +501,7 @@ char *message_editor() {
} else if (ch.chKeyPress == OD_KEY_F10) {
// load draft
if (load_draft() != NULL) {
snprintf(draft_path, PATH_MAX, "drafts/%s/%s.draft", od_control_get()->user_name, draft_filename);
snprintf(draft_path, PATH_MAX, DRAFT_PATH "drafts/%s/%s.draft", od_control_get()->user_name, draft_filename);
fptr = fopen(draft_path, "r");
if (!fptr) {
// error loading draft