diff --git a/GNUmakefile b/GNUmakefile index 24833bc..1561d18 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,6 +1,6 @@ -OS := $(shell uname -s | tr '[A-Z]' '[a-z]' | sed 's/darwin/osx/') +OS:= $(shell uname -s | tr '[A-Z]' '[a-z]' | sed 's/darwin/osx/') -all: magicka +all: magicka .PHONY: magicka www clean cleanwww @@ -8,10 +8,10 @@ magicka: cd src && $(MAKE) -f GNUmakefile.$(OS) www: - cd src && $(MAKE) -f GNUmakefile.$(OS).WWW + cd src && $(MAKE) -f GNUmakefile.$(OS) www clean: cd src && $(MAKE) -f GNUmakefile.$(OS) clean cleanwww: - cd src && $(MAKE) -f GNUmakefile.$(OS).WWW clean + cd src && $(MAKE) -f GNUmakefile.$(OS) clean diff --git a/src/GNUmakefile.common b/src/GNUmakefile.common index 45042f7..5d10e9e 100644 --- a/src/GNUmakefile.common +++ b/src/GNUmakefile.common @@ -1,102 +1,114 @@ +OS:= $(shell uname -s) DEPSDIR:= ../deps -CFLAGS:= $(CFLAGS) -I$(DEPSDIR) +UTILSDIR:= ../utils +CFLAGS:= ${CFLAGS} -I${DEPSDIR} ${EXTRA_INCLUDES} -JAMLIB= ../deps/jamlib/jamlib.a -ZMODEM= ../deps/Xmodem/libzmodem.a -LUA= ../deps/lua/liblua.a -ODOORS= ../deps/odoors/libs-`uname -s`/libODoors.a -JSMN= ../deps/jsmn/libjsmn.a -CDK= ../deps/cdk-5-20161210/libcdk.a -UUID= ../deps/libuuid/.libs/libuuid.a +JAMLIB:= ${DEPSDIR}/jamlib/jamlib.a +ZMODEM:= ${DEPSDIR}/Xmodem/libzmodem.a +B64:= ${DEPSDIR}/libb64-1.2/src/libb64.a +LUA:= ${DEPSDIR}/lua/liblua.a +ODOORS:= ${DEPSDIR}/odoors/libs-${OS}/libODoors.a +JSMN:= ${DEPSDIR}/jsmn/libjsmn.a +CDK:= ${DEPSDIR}/cdk-5-20161210/libcdk.a +UUID:= ${DEPSDIR}/libuuid/.libs/libuuid.a all: magicka magimail magiedit ticproc mgpost magichat \ filecenter dosbox_shim magiftpd reset_pass ${LUA}: - cd ../deps/lua && $(MAKE) -f Makefile ${DEPS_LUA_TARGET} MAKEFLAGS= - + cd ${DEPSDIR}/lua && ${MAKE} -f Makefile ${DEPS_LUA_TARGET} MAKEFLAGS= CC=${CC} + ${JAMLIB}: - cd ../deps/jamlib && $(MAKE) -f ${DEPS_JAMLIB_MAKEFILE} MAKEFLAGS= - + cd ${DEPSDIR}/jamlib && ${MAKE} -f ${DEPS_JAMLIB_MAKEFILE} MAKEFLAGS= + ${ZMODEM}: - cd ../deps/Xmodem && $(MAKE) MAKEFLAGS= + cd ${DEPSDIR}/Xmodem && ${MAKE} MAKEFLAGS= CC=${CC} + +${B64}: + cd ${DEPSDIR}/libb64-1.2 && ${MAKE} MAKEFLAGS= CC=${CC} ${ODOORS}: - cd ../deps/odoors/ && $(MAKE) + cd ${DEPSDIR}/odoors/ && ${MAKE} CC=${CC} -$(JSMN): - cd ../deps/jsmn/ && $(MAKE) +${JSMN}: + cd ${DEPSDIR}/jsmn/ && ${MAKE} CC=${CC} -$(CDK): - cd ../deps/cdk-5.0-20161210/ && export CPPFLAGS=$(INCDIRS) && ./configure --with-ncurses - cd ../deps/cdk-5.0-20161210/ && $(MAKE) +${CDK}: + cd ${DEPSDIR}/cdk-5.0-20161210/ && ./configure --with-ncurses && ${MAKE} CC=${CC} -$(UUID): - rm ../deps/libuuid/ltmain.sh ../deps/libuuid/libtool || true - cd ../deps/libuuid/ && libtoolize - cd ../deps/libuuid/ && autoreconf - cd ../deps/libuuid/ && ./configure - cd ../deps/libuuid/ && $(MAKE) +${UUID}: + rm ${DEPSDIR}/libuuid/ltmain.sh ${DEPSDIR}/libuuid/libtool || true + cd ${DEPSDIR}/libuuid/ && libtoolize + cd ${DEPSDIR}/libuuid/ && autoreconf + cd ${DEPSDIR}/libuuid/ && ./configure + cd ${DEPSDIR}/libuuid/ && ${MAKE} CC=${CC} HDRS:= bbs.h -OBJ:= inih/ini.o bbs.o main.o users.o main_menu.o mail_menu.o \ +OBJS:= inih/ini.o bbs.o main.o users.o main_menu.o mail_menu.o \ doors.o bbs_list.o chat_system.o email.o files.o settings.o \ lua_glue.o strings.o bluewave.o hashmap/hashmap.o menus.o \ nodelist.o blog.o -%.o: %.c $(HDRS) - $(CC) -c -o $@ $< $(CFLAGS) +WWWOBJS:= ../deps/aha/aha.o ../deps/hashids/hashids.o www.o www_email.o \ + www_msgs.o www_last10.o www_blog.o www_files.o ${OBJS} -magicka: $(OBJ) ${LUA} ${ZMODEM} ${JAMLIB} ${JSMN} ${UUID} - $(CC) -o ../magicka $^ $(LIBS) +ifeq ($(MAKECMDGOALS), www) +CFLAGS+= ${CFLAGS} -I${DEPSDIR}/libb64-1.2/include -DENABLE_WWW=1 +endif + +%.o: %.c ${HDRS} + ${CC} -c -o $@ $< ${CFLAGS} + +www: ${OBJS} ${WWWOBJS} ${LUA} ${ZMODEM} ${B64} ${JAMLIB} ${JSMN} ${UUID} + ${CC} -o ../magicka $^ ${LIBS} -lmicrohttpd + +magicka: ${OBJS} ${LUA} ${ZMODEM} ${JAMLIB} ${JSMN} ${UUID} + ${CC} -o ../magicka $^ ${LIBS} -MAGIEDIT_MAKEFILE?= Makefile +magiedit: ${ODOORS} + cd ${UTILSDIR}/magiedit && ${MAKE} -magiedit: $(ODOORS) - cd ../utils/magiedit && $(MAKE) -f ${MAGIEDIT_MAKEFILE} - -magimail: $(JAMLIB) - cd ../utils/magimail && $(MAKE) $(MAGIMAIL_TARGET) +magimail: ${JAMLIB} + cd ${UTILSDIR}/magimail && ${MAKE} ticproc: - cd ../utils/ticproc && $(MAKE) + cd ${UTILSDIR}/ticproc && ${MAKE} -mgpost: $(JAMLIB) - cd ../utils/mgpost && $(MAKE) +mgpost: ${JAMLIB} + cd ${UTILSDIR}/mgpost && ${MAKE} -MAGICHAT_MAKEFILE?= Makefile +magichat: ${JSMN} + cd ${UTILSDIR}/magichat && ${MAKE} -magichat: $(JSMN) - cd ../utils/magichat && $(MAKE) -f ${MAGICHAT_MAKEFILE} - -filecenter: $(CDK) - cd ../utils/filecenter && $(MAKE) +filecenter: ${CDK} + cd ${UTILSDIR}/filecenter && ${MAKE} dosbox_shim: - cd ../utils/dosbox_shim && $(MAKE) + cd ${UTILSDIR}/dosbox_shim && ${MAKE} magiftpd: - cd ../utils/magiftpd && $(MAKE) + cd ${UTILSDIR}/magiftpd && ${MAKE} reset_pass: - cd ../utils/reset_pass && $(MAKE) + cd ${UTILSDIR}/reset_pass && ${MAKE} .PHONY: clean clean: - rm -f $(OBJ) ../magicka - cd ../deps/lua && $(MAKE) clean - cd ../deps/jamlib && $(MAKE) -f Makefile.linux clean - cd ../deps/Xmodem && $(MAKE) clean - cd ../utils/magimail && $(MAKE) cleanfreebsd - cd ../utils/magiedit && $(MAKE) clean - cd ../deps/odoors/ && rm -rf libs-`uname -s` objs-`uname -s` exe-`uname -s` - cd ../utils/ticproc && $(MAKE) clean - cd ../utils/mgpost && $(MAKE) clean - cd ../utils/magichat && $(MAKE) clean - cd ../deps/cdk-5.0-20161210 && $(MAKE) clean - cd ../utils/filecenter && $(MAKE) clean - cd ../utils/magiftpd && $(MAKE) clean - cd ../utils/reset_pass && $(MAKE) clean - cd ../utils/dosbox_shim && $(MAKE) clean + rm -f ${OBJS} ${WWWOBJS} ../magicka + cd ${DEPSDIR}/lua && ${MAKE} clean + cd ${DEPSDIR}/jamlib && ${MAKE} -f ${DEPS_JAMLIB_MAKEFILE} clean + cd ${DEPSDIR}/Xmodem && ${MAKE} clean + cd ${UTILSDIR}/magimail && ${MAKE} clean + cd ${UTILSDIR}/magiedit && ${MAKE} clean + cd ${DEPSDIR}/odoors && rm -rf libs-${OS} objs-${OS} exe-${OS} + cd ${UTILSDIR}/ticproc && ${MAKE} clean + cd ${UTILSDIR}/mgpost && ${MAKE} clean + cd ${UTILSDIR}/magichat && ${MAKE} clean + cd ${DEPSDIR}/libb64-1.2 && ${MAKE} clean + cd ${DEPSDIR}/cdk-5.0-20161210 && ${MAKE} clean + cd ${UTILSDIR}/filecenter && ${MAKE} clean + cd ${UTILSDIR}/magiftpd && ${MAKE} clean + cd ${UTILSDIR}/reset_pass && ${MAKE} clean + cd ${UTILSDIR}/dosbox_shim && ${MAKE} clean diff --git a/src/GNUmakefile.freebsd b/src/GNUmakefile.freebsd index e10e396..a21f66d 100644 --- a/src/GNUmakefile.freebsd +++ b/src/GNUmakefile.freebsd @@ -4,6 +4,5 @@ LIBS:= -L/usr/local/lib -lsqlite3 -lutil -lm -lssl -lcrypto -lssh -liconv -lmo DEPS_LUA_TARGET:= freebsd DEPS_JAMLIB_MAKEFILE:= Makefile.linux -MAGIMAIL_TARGET:= freebsd include GNUmakefile.common diff --git a/src/GNUmakefile.freebsd.WWW b/src/GNUmakefile.freebsd.WWW deleted file mode 100644 index f64fc33..0000000 --- a/src/GNUmakefile.freebsd.WWW +++ /dev/null @@ -1,97 +0,0 @@ -CC=cc -CFLAGS=-std=gnu99 -I/usr/local/include -I../deps/ -I../deps/libb64-1.2/include -DENABLE_WWW=1 -DEPS = bbs.h -JAMLIB = ../deps/jamlib/jamlib.a -ZMODEM = ../deps/Xmodem/libzmodem.a -LUA = ../deps/lua/liblua.a -B64 = ../deps/libb64-1.2/src/libb64.a -MICROHTTPD=-lmicrohttpd -ODOORS = ../deps/odoors/libs-`uname -s`/libODoors.a -JSMN = ../deps/jsmn/libjsmn.a -CDK = ../deps/cdk-5-20161210/libcdk.a -UUID = ../deps/libuuid/.libs/libuuid.a - -all: magicka magimail magiedit ticproc mgpost magichat filecenter dosbox_shim magiftpd reset_pass - -${LUA}: - cd ../deps/lua && $(MAKE) -f Makefile freebsd MAKEFLAGS= - -${JAMLIB}: - cd ../deps/jamlib && $(MAKE) -f Makefile.linux MAKEFLAGS= - -${ZMODEM}: - cd ../deps/Xmodem && $(MAKE) MAKEFLAGS= - -${B64}: - cd ../deps/libb64-1.2 && $(MAKE) MAKEFLAGS= - -${ODOORS}: - cd ../deps/odoors/ && $(MAKE) - -$(JSMN): - cd ../deps/jsmn/ && $(MAKE) - -$(CDK): - cd ../deps/cdk-5.0-20161210/ && export CPPFLAGS=-I/usr/local/include && ./configure --with-ncurses - cd ../deps/cdk-5.0-20161210/ && $(MAKE) - -$(UUID): - rm ../deps/libuuid/ltmain.sh ../deps/libuuid/libtool || true - cd ../deps/libuuid/ && libtoolize - cd ../deps/libuuid/ && autoreconf - cd ../deps/libuuid/ && ./configure - cd ../deps/libuuid/ && $(MAKE) - -OBJ = ../deps/aha/aha.o ../deps/hashids/hashids.o inih/ini.o bbs.o main.o users.o main_menu.o mail_menu.o doors.o bbs_list.o chat_system.o email.o files.o settings.o lua_glue.o strings.o bluewave.o www.o www_email.o www_msgs.o www_last10.o www_blog.o www_files.o hashmap/hashmap.o menus.o nodelist.o blog.o -%.o: %.c $(DEPS) - $(CC) -c -o $@ $< $(CFLAGS) - -magicka: $(OBJ) ${LUA} ${ZMODEM} ${JAMLIB} ${B64} ${JSMN} ${UUID} - $(CC) -o ../magicka $^ $(CFLAGS) -L/usr/local/lib -lsqlite3 -lutil -lm -lssl -lcrypto -lssh -liconv -lmosquitto $(MICROHTTPD) - -magimail: $(JAMLIB) - cd ../utils/magimail && $(MAKE) freebsd - -magiedit: $(ODOORS) - cd ../utils/magiedit && $(MAKE) - -ticproc: - cd ../utils/ticproc && $(MAKE) - -mgpost: $(JAMLIB) - cd ../utils/mgpost && $(MAKE) - -magichat: $(JSMN) - cd ../utils/magichat && $(MAKE) - -filecenter: $(CDK) - cd ../utils/filecenter && $(MAKE) - -dosbox_shim: - cd ../utils/dosbox_shim && $(MAKE) - -magiftpd: - cd ../utils/magiftpd && $(MAKE) - -reset_pass: - cd ../utils/reset_pass && $(MAKE) - -.PHONY: clean - -clean: - rm -f $(OBJ) ../magicka - cd ../deps/lua && $(MAKE) clean - cd ../deps/jamlib && $(MAKE) -f Makefile.linux clean - cd ../deps/Xmodem && $(MAKE) clean - cd ../deps/libb64-1.2 && $(MAKE) clean - cd ../utils/magimail && $(MAKE) cleanfreebsd - cd ../utils/magiedit && $(MAKE) clean - cd ../deps/odoors/ && rm -rf libs-`uname -s` objs-`uname -s` exe-`uname -s` - cd ../utils/ticproc && $(MAKE) clean - cd ../utils/mgpost && $(MAKE) clean - cd ../utils/magichat && $(MAKE) clean - cd ../deps/cdk-5.0-20161210 && $(MAKE) clean - cd ../utils/filecenter && $(MAKE) clean - cd ../utils/magiftpd && $(MAKE) clean - cd ../utils/reset_pass && $(MAKE) clean - cd ../utils/dosbox_shim && $(MAKE) clean diff --git a/src/GNUmakefile.linux b/src/GNUmakefile.linux index 54fd54b..715271d 100644 --- a/src/GNUmakefile.linux +++ b/src/GNUmakefile.linux @@ -4,6 +4,5 @@ LIBS:= -L/usr/local/lib -lsqlite3 -lutil -lm -ldl -lssl -lcrypto -lssh -lmosqu DEPS_LUA_TARGET:= linux DEPS_JAMLIB_MAKEFILE:= Makefile.linux -MAGIMAIL_TARGET:= freebsd include GNUmakefile.common diff --git a/src/GNUmakefile.linux.WWW b/src/GNUmakefile.linux.WWW deleted file mode 100644 index b921cb9..0000000 --- a/src/GNUmakefile.linux.WWW +++ /dev/null @@ -1,97 +0,0 @@ -CC=cc -CFLAGS=-std=gnu99 -I/usr/local/include -I../deps/ -I../deps/libb64-1.2/include -DENABLE_WWW=1 -DEPS = bbs.h -JAMLIB = ../deps/jamlib/jamlib.a -ZMODEM = ../deps/Xmodem/libzmodem.a -LUA = ../deps/lua/liblua.a -B64 = ../deps/libb64-1.2/src/libb64.a -MICROHTTPD=-lmicrohttpd -ODOORS = ../deps/odoors/libs-`uname -s`/libODoors.a -JSMN = ../deps/jsmn/libjsmn.a -CDK = ../deps/cdk-5-20161210/libcdk.a -UUID = ../deps/libuuid/.libs/libuuid.a - -all: magicka magimail magiedit ticproc mgpost magichat filecenter dosbox_shim magiftpd reset_pass - -${LUA}: - cd ../deps/lua && $(MAKE) -f Makefile linux MAKEFLAGS= - -${JAMLIB}: - cd ../deps/jamlib && $(MAKE) -f Makefile.linux MAKEFLAGS= - -${ZMODEM}: - cd ../deps/Xmodem && $(MAKE) MAKEFLAGS= - -${B64}: - cd ../deps/libb64-1.2 && $(MAKE) MAKEFLAGS= - -${ODOORS}: - cd ../deps/odoors/ && $(MAKE) - -$(JSMN): - cd ../deps/jsmn/ && $(MAKE) - -$(CDK): - cd ../deps/cdk-5.0-20161210/ && ./configure - cd ../deps/cdk-5.0-20161210/ && $(MAKE) - -$(UUID): - rm ../deps/libuuid/ltmain.sh ../deps/libuuid/libtool || true - cd ../deps/libuuid/ && libtoolize - cd ../deps/libuuid/ && autoreconf - cd ../deps/libuuid/ && ./configure - cd ../deps/libuuid/ && $(MAKE) - -OBJ = ../deps/aha/aha.o ../deps/hashids/hashids.o inih/ini.o bbs.o main.o users.o main_menu.o mail_menu.o doors.o bbs_list.o chat_system.o email.o files.o settings.o lua_glue.o strings.o www.o www_email.o www_msgs.o www_last10.o www_blog.o www_files.o bluewave.o hashmap/hashmap.o menus.o nodelist.o blog.o -%.o: %.c $(DEPS) - $(CC) -c -o $@ $< $(CFLAGS) - -magicka: $(OBJ) ${LUA} ${JAMLIB} ${ZMODEM} ${B64} ${JSMN} ${UUID} - $(CC) -o ../magicka $^ $(CFLAGS) -L/usr/local/lib -lsqlite3 -lutil -lm -ldl -lssl -lcrypto -lssh -lmosquitto $(MICROHTTPD) - -magimail: $(JAMLIB) - cd ../utils/magimail && $(MAKE) linux - -magiedit: $(ODOORS) - cd ../utils/magiedit && $(MAKE) - -ticproc: - cd ../utils/ticproc && $(MAKE) - -mgpost: $(JAMLIB) - cd ../utils/mgpost && $(MAKE) - -magichat: $(JSMN) - cd ../utils/magichat && $(MAKE) - -filecenter: $(CDK) - cd ../utils/filecenter && $(MAKE) - -dosbox_shim: - cd ../utils/dosbox_shim && $(MAKE) - -magiftpd: - cd ../utils/magiftpd && $(MAKE) - -reset_pass: - cd ../utils/reset_pass && $(MAKE) - -.PHONY: clean - -clean: - rm -f $(OBJ) ../magicka - cd ../deps/lua && $(MAKE) clean - cd ../deps/jamlib && $(MAKE) -f Makefile.linux clean - cd ../deps/Xmodem && $(MAKE) clean - cd ../deps/libb64-1.2 && $(MAKE) clean - cd ../utils/magimail && $(MAKE) cleanlinux - cd ../utils/magiedit && $(MAKE) clean - cd ../deps/odoors/ && rm -rf libs-`uname -s` objs-`uname -s` exe-`uname -s` - cd ../utils/ticproc && $(MAKE) clean - cd ../utils/mgpost && $(MAKE) clean - cd ../utils/magichat && $(MAKE) clean - cd ../deps/cdk-5.0-20161210 && $(MAKE) clean - cd ../utils/filecenter && $(MAKE) clean - cd ../utils/magiftpd && $(MAKE) clean - cd ../utils/reset_pass && $(MAKE) clean - cd ../utils/dosbox_shim && $(MAKE) clean diff --git a/src/GNUmakefile.netbsd b/src/GNUmakefile.netbsd index 600e1b3..2cf4442 100644 --- a/src/GNUmakefile.netbsd +++ b/src/GNUmakefile.netbsd @@ -4,6 +4,5 @@ LIBS:= -R/usr/pkg/lib -L/usr/pkg/lib -lsqlite3 -lutil -lm -lssl -lcrypto -lssh DEPS_LUA_TARGET:= bsd DEPS_JAMLIB_MAKEFILE:= Makefile.linux -MAGIMAIL_TARGET:= freebsd include GNUmakefile.common diff --git a/src/GNUmakefile.netbsd.WWW b/src/GNUmakefile.netbsd.WWW deleted file mode 100644 index ea36e5e..0000000 --- a/src/GNUmakefile.netbsd.WWW +++ /dev/null @@ -1,97 +0,0 @@ -CC=cc -CFLAGS=-std=gnu99 -I/usr/pkg/include -I../deps/ -I../deps/libb64-1.2/include -DENABLE_WWW=1 -DEPS = bbs.h -JAMLIB = ../deps/jamlib/jamlib.a -ZMODEM = ../deps/Xmodem/libzmodem.a -LUA = ../deps/lua/liblua.a -B64 = ../deps/libb64-1.2/src/libb64.a -MICROHTTPD=-lmicrohttpd -ODOORS = ../deps/odoors/libs-`uname -s`/libODoors.a -JSMN = ../deps/jsmn/libjsmn.a -CDK = ../deps/cdk-5-20161210/libcdk.a -UUID = ../deps/libuuid/.libs/libuuid.a - -all: magicka magimail magiedit ticproc mgpost magichat filecenter dosbox_shim magiftpd reset_pass - -${LUA}: - cd ../deps/lua && $(MAKE) -f Makefile bsd MAKEFLAGS= - -${JAMLIB}: - cd ../deps/jamlib && $(MAKE) -f Makefile.linux MAKEFLAGS= - -${ZMODEM}: - cd ../deps/Xmodem && $(MAKE) MAKEFLAGS= - -${B64}: - cd ../deps/libb64-1.2 && $(MAKE) MAKEFLAGS= - -${ODOORS}: - cd ../deps/odoors/ && $(MAKE) - -$(JSMN): - cd ../deps/jsmn/ && $(MAKE) - -$(CDK): - cd ../deps/cdk-5.0-20161210/ && export CPPFLAGS=-I/usr/pkg/include && ./configure --with-ncurses - cd ../deps/cdk-5.0-20161210/ && $(MAKE) - -$(UUID): - rm ../deps/libuuid/ltmain.sh ../deps/libuuid/libtool || true - cd ../deps/libuuid/ && libtoolize - cd ../deps/libuuid/ && autoreconf - cd ../deps/libuuid/ && ./configure - cd ../deps/libuuid/ && $(MAKE) - -OBJ = ../deps/aha/aha.o ../deps/hashids/hashids.o inih/ini.o bbs.o main.o users.o main_menu.o mail_menu.o doors.o bbs_list.o chat_system.o email.o files.o settings.o lua_glue.o strings.o bluewave.o www.o www_email.o www_msgs.o www_last10.o www_files.o www_blog.o hashmap/hashmap.o menus.o nodelist.o blog.o -%.o: %.c $(DEPS) - $(CC) -c -o $@ $< $(CFLAGS) - -magicka: $(OBJ) ${LUA} ${ZMODEM} ${JAMLIB} ${B64} ${JSMN} ${UUID} - $(CC) -o ../magicka $^ $(CFLAGS) -R/usr/pkg/lib -L/usr/pkg/lib -lsqlite3 -lutil -lm -lssl -lcrypto -lssh -liconv -lmosquitto $(MICROHTTPD) - -magiedit: $(ODOORS) - cd ../utils/magiedit && $(MAKE) - -magimail: $(JAMLIB) - cd ../utils/magimail && $(MAKE) freebsd - -ticproc: - cd ../utils/ticproc && $(MAKE) - -mgpost: $(JAMLIB) - cd ../utils/mgpost && $(MAKE) - -magichat: $(JSMN) - cd ../utils/magichat && $(MAKE) - -filecenter: $(CDK) - cd ../utils/filecenter && $(MAKE) - -dosbox_shim: - cd ../utils/dosbox_shim && $(MAKE) - -magiftpd: - cd ../utils/magiftpd && $(MAKE) - -reset_pass: - cd ../utils/reset_pass && $(MAKE) - -.PHONY: clean - -clean: - rm -f $(OBJ) ../magicka - cd ../deps/lua && $(MAKE) clean - cd ../deps/jamlib && $(MAKE) -f Makefile.linux clean - cd ../deps/Xmodem && $(MAKE) clean - cd ../deps/libb64-1.2 && $(MAKE) clean - cd ../utils/magimail && $(MAKE) cleanfreebsd - cd ../utils/magiedit && $(MAKE) clean - cd ../deps/odoors/ && rm -rf libs-`uname -s` objs-`uname -s` exe-`uname -s` - cd ../utils/ticproc && $(MAKE) clean - cd ../utils/mgpost && $(MAKE) clean - cd ../utils/magichat && $(MAKE) clean - cd ../deps/cdk-5.0-20161210 && $(MAKE) clean - cd ../utils/filecenter && $(MAKE) clean - cd ../utils/magiftpd && $(MAKE) clean - cd ../utils/reset_pass && $(MAKE) clean - cd ../utils/dosbox_shim && $(MAKE) clean \ No newline at end of file diff --git a/src/GNUmakefile.openbsd b/src/GNUmakefile.openbsd index 8f53180..0dfe079 100644 --- a/src/GNUmakefile.openbsd +++ b/src/GNUmakefile.openbsd @@ -4,6 +4,5 @@ LIBS:= -L/usr/local/lib -lsqlite3 -lutil -lm -lssl -lcrypto -lssh -liconv -lmo DEPS_LUA_TARGET:= bsd DEPS_JAMLIB_MAKEFILE:= Makefile.linux -MAGIMAIL_TARGET:= freebsd include GNUmakefile.common diff --git a/src/GNUmakefile.openbsd.WWW b/src/GNUmakefile.openbsd.WWW deleted file mode 100644 index 7762658..0000000 --- a/src/GNUmakefile.openbsd.WWW +++ /dev/null @@ -1,97 +0,0 @@ -CC=cc -CFLAGS=-std=gnu99 -I/usr/local/include -I../deps/ -I../deps/libb64-1.2/include -DENABLE_WWW=1 -DEPS = bbs.h -JAMLIB = ../deps/jamlib/jamlib.a -ZMODEM = ../deps/Xmodem/libzmodem.a -LUA = ../deps/lua/liblua.a -B64 = ../deps/libb64-1.2/src/libb64.a -MICROHTTPD=-lmicrohttpd -ODOORS = ../deps/odoors/libs-`uname -s`/libODoors.a -JSMN = ../deps/jsmn/libjsmn.a -CDK = ../deps/cdk-5-20161210/libcdk.a -UUID = ../deps/libuuid/.libs/libuuid.a - -all: magicka magimail magiedit ticproc mgpost magichat filecenter dosbox_shim magiftpd reset_pass - -${LUA}: - cd ../deps/lua && $(MAKE) -f Makefile bsd MAKEFLAGS= - -${JAMLIB}: - cd ../deps/jamlib && $(MAKE) -f Makefile.linux MAKEFLAGS= - -${ZMODEM}: - cd ../deps/Xmodem && $(MAKE) MAKEFLAGS= - -${B64}: - cd ../deps/libb64-1.2 && $(MAKE) MAKEFLAGS= - -${ODOORS}: - cd ../deps/odoors/ && $(MAKE) - -$(JSMN): - cd ../deps/jsmn/ && $(MAKE) - -$(CDK): - cd ../deps/cdk-5.0-20161210/ && export CPPFLAGS=-I/usr/local/include && ./configure --with-ncurses - cd ../deps/cdk-5.0-20161210/ && $(MAKE) - -$(UUID): - rm ../deps/libuuid/ltmain.sh ../deps/libuuid/libtool || true - cd ../deps/libuuid/ && libtoolize - cd ../deps/libuuid/ && autoreconf - cd ../deps/libuuid/ && ./configure - cd ../deps/libuuid/ && $(MAKE) - -OBJ = ../deps/aha/aha.o ../deps/hashids/hashids.o inih/ini.o bbs.o main.o users.o main_menu.o mail_menu.o doors.o bbs_list.o chat_system.o email.o files.o settings.o lua_glue.o strings.o bluewave.o www.o www_email.o www_msgs.o www_last10.o www_files.o www_blog.o hashmap/hashmap.o menus.o nodelist.o blog.o -%.o: %.c $(DEPS) - $(CC) -c -o $@ $< $(CFLAGS) - -magicka: $(OBJ) ${LUA} ${ZMODEM} ${JAMLIB} ${B64} ${JSMN} ${UUID} - $(CC) -o ../magicka $^ $(CFLAGS) -L/usr/local/lib -lsqlite3 -lutil -lm -lssl -lcrypto -lssh -liconv -lmosquitto $(MICROHTTPD) - -magiedit: $(ODOORS) - cd ../utils/magiedit && $(MAKE) - -magimail: $(JAMLIB) - cd ../utils/magimail && $(MAKE) freebsd - -ticproc: - cd ../utils/ticproc && $(MAKE) - -mgpost: $(JAMLIB) - cd ../utils/mgpost && $(MAKE) - -magichat: $(JSMN) - cd ../utils/magichat && $(MAKE) - -filecenter: $(CDK) - cd ../utils/filecenter && $(MAKE) - -dosbox_shim: - cd ../utils/dosbox_shim && $(MAKE) - -magiftpd: - cd ../utils/magiftpd && $(MAKE) - -reset_pass: - cd ../utils/reset_pass && $(MAKE) - -.PHONY: clean - -clean: - rm -f $(OBJ) ../magicka - cd ../deps/lua && $(MAKE) clean - cd ../deps/jamlib && $(MAKE) -f Makefile.linux clean - cd ../deps/Xmodem && $(MAKE) clean - cd ../deps/libb64-1.2 && $(MAKE) clean - cd ../utils/magimail && $(MAKE) cleanfreebsd - cd ../utils/magiedit && $(MAKE) clean - cd ../deps/odoors/ && rm -rf libs-`uname -s` objs-`uname -s` exe-`uname -s` - cd ../utils/ticproc && $(MAKE) clean - cd ../utils/mgpost && $(MAKE) clean - cd ../utils/magichat && $(MAKE) clean - cd ../deps/cdk-5.0-20161210 && $(MAKE) clean - cd ../utils/filecenter && $(MAKE) clean - cd ../utils/magiftpd && $(MAKE) clean - cd ../utils/reset_pass && $(MAKE) clean - cd ../utils/dosbox_shim && $(MAKE) clean diff --git a/src/GNUmakefile.osx b/src/GNUmakefile.osx index e00ce91..676d9ed 100644 --- a/src/GNUmakefile.osx +++ b/src/GNUmakefile.osx @@ -4,6 +4,5 @@ LIBS:= -L/opt/local/lib -lsqlite3 -lutil -lm -ldl -lssl -lcrypto -lssh -liconv DEPS_LUA_TARGET:= macosx DEPS_JAMLIB_MAKEFILE:= Makefile.linux -MAGIMAIL_TARGET:= linux include GNUmakefile.common diff --git a/src/GNUmakefile.osx.WWW b/src/GNUmakefile.osx.WWW deleted file mode 100644 index 17c2664..0000000 --- a/src/GNUmakefile.osx.WWW +++ /dev/null @@ -1,96 +0,0 @@ -CC=cc -CFLAGS=-std=gnu99 -I/opt/local/include -I../deps/ -I../deps/libb64-1.2/include -DENABLE_WWW=1 -Wall -DEPS = bbs.h -JAMLIB = ../deps/jamlib/jamlib.a -ZMODEM = ../deps/Xmodem/libzmodem.a -LUA = ../deps/lua/liblua.a -B64 = ../deps/libb64-1.2/src/libb64.a -MICROHTTPD=-lmicrohttpd -ODOORS = ../deps/odoors/libs-`uname -s`/libODoors.a -JSMN = ../deps/jsmn/libjsmn.a -CDK = ../deps/cdk-5-20161210/libcdk.a -UUID = ../deps/libuuid/.libs/libuuid.a - -all: magicka magimail magiedit ticproc mgpost magichat filecenter dosbox_shim magiftpd reset_pass - -${LUA}: - cd ../deps/lua && $(MAKE) -f Makefile macosx MAKEFLAGS= - -${JAMLIB}: - cd ../deps/jamlib && $(MAKE) -f Makefile.linux MAKEFLAGS= - -${ZMODEM}: - cd ../deps/Xmodem && $(MAKE) MAKEFLAGS= - -${B64}: - cd ../deps/libb64-1.2 && $(MAKE) MAKEFLAGS= - -${ODOORS}: - cd ../deps/odoors/ && $(MAKE) - -$(JSMN): - cd ../deps/jsmn/ && $(MAKE) - -$(CDK): - cd ../deps/cdk-5.0-20161210/ && ./configure - cd ../deps/cdk-5.0-20161210/ && $(MAKE) - -$(UUID): - rm ../deps/libuuid/ltmain.sh ../deps/libuuid/libtool || true - cd ../deps/libuuid/ && glibtoolize - cd ../deps/libuuid/ && autoreconf - cd ../deps/libuuid/ && ./configure - cd ../deps/libuuid/ && $(MAKE) - -OBJ = ../deps/aha/aha.o ../deps/hashids/hashids.o inih/ini.o bbs.o main.o users.o main_menu.o mail_menu.o doors.o bbs_list.o chat_system.o email.o files.o settings.o lua_glue.o strings.o www.o www_email.o www_msgs.o www_last10.o www_files.o www_blog.o bluewave.o hashmap/hashmap.o menus.o nodelist.o blog.o -%.o: %.c $(DEPS) - $(CC) -c -o $@ $< $(CFLAGS) - -magicka: $(OBJ) ${LUA} ${ZMODEM} ${JAMLIB} ${B64} ${JSMN} ${UUID} - $(CC) -o ../magicka $^ $(CFLAGS) -L/opt/local/lib -lsqlite3 -lutil -lm -ldl -lssl -lcrypto -lssh -liconv -lmosquitto $(MICROHTTPD) - -magimail: $(JAMLIB) - cd ../utils/magimail && $(MAKE) linux - -magiedit: $(ODOORS) - cd ../utils/magiedit && $(MAKE) - -ticproc: - cd ../utils/ticproc && $(MAKE) - -mgpost: $(JAMLIB) - cd ../utils/mgpost && $(MAKE) - -magichat: $(JSMN) - cd ../utils/magichat && $(MAKE) - -filecenter: $(CDK) - cd ../utils/filecenter && $(MAKE) - -dosbox_shim: - cd ../utils/dosbox_shim && $(MAKE) - -magiftpd: - cd ../utils/magiftpd && $(MAKE) - -reset_pass: - cd ../utils/reset_pass && $(MAKE) - -.PHONY: clean - -clean: - rm -f $(OBJ) ../magicka - cd ../deps/lua && $(MAKE) clean - cd ../deps/jamlib && $(MAKE) -f Makefile.linux clean - cd ../deps/Xmodem && $(MAKE) clean - cd ../utils/magimail && $(MAKE) cleanlinux - cd ../utils/magiedit && $(MAKE) clean - cd ../deps/odoors/ && rm -rf libs-`uname -s` objs-`uname -s` exe-`uname -s` - cd ../utils/ticproc && $(MAKE) clean - cd ../utils/mgpost && $(MAKE) clean - cd ../utils/magichat && $(MAKE) clean - cd ../deps/cdk-5.0-20161210 && $(MAKE) clean - cd ../utils/filecenter && $(MAKE) clean - cd ../utils/magiftpd && $(MAKE) clean - cd ../utils/reset_pass && $(MAKE) clean - cd ../utils/dosbox_shim && $(MAKE) clean \ No newline at end of file diff --git a/src/GNUmakefile.sunos b/src/GNUmakefile.sunos index 734240c..7a21a3e 100644 --- a/src/GNUmakefile.sunos +++ b/src/GNUmakefile.sunos @@ -4,8 +4,5 @@ LIBS:= -L/usr/local/lib -lsqlite3 -lm -ldl -lssl -lcrypto -lssh -lmosquitto -l DEPS_LUA_TARGET:= solaris DEPS_JAMLIB_MAKEFILE:= Makefile.sunos -MAGIMAIL_TARGET:= freebsd -MAGIEDIT_MAKEFILE:= Makefile.sunos -MAGICHAT_MAKEFILE:= Makefile.sunos include GNUmakefile.common diff --git a/src/GNUmakefile.sunos.WWW b/src/GNUmakefile.sunos.WWW deleted file mode 100644 index 281239f..0000000 --- a/src/GNUmakefile.sunos.WWW +++ /dev/null @@ -1,97 +0,0 @@ -CC=gcc -CFLAGS=-std=gnu99 -I/usr/local/include -I../deps/ -I../deps/libb64-1.2/include -DENABLE_WWW=1 -DEPS = bbs.h -JAMLIB = ../deps/jamlib/jamlib.a -ZMODEM = ../deps/Xmodem/libzmodem.a -LUA = ../deps/lua/liblua.a -B64 = ../deps/libb64-1.2/src/libb64.a -MICROHTTPD=-lmicrohttpd -ODOORS = ../deps/odoors/libs-`uname -s`/libODoors.a -JSMN = ../deps/jsmn/libjsmn.a -CDK = ../deps/cdk-5-20161210/libcdk.a -UUID = ../deps/libuuid/.libs/libuuid.a - -all: magicka magimail magiedit ticproc mgpost magichat filecenter magiftpd reset_pass - -${LUA}: - cd ../deps/lua && $(MAKE) -f Makefile solaris MAKEFLAGS= - -${JAMLIB}: - cd ../deps/jamlib && $(MAKE) -f Makefile.sunos MAKEFLAGS= - -${ZMODEM}: - cd ../deps/Xmodem && $(MAKE) MAKEFLAGS= - -${B64}: - cd ../deps/libb64-1.2 && $(MAKE) MAKEFLAGS= CC=gcc - -${ODOORS}: - cd ../deps/odoors/ && $(MAKE) - -$(JSMN): - cd ../deps/jsmn/ && $(MAKE) - -$(CDK): - cd ../deps/cdk-5.0-20161210/ && ./configure - cd ../deps/cdk-5.0-20161210/ && $(MAKE) - -$(UUID): - rm ../deps/libuuid/ltmain.sh ../deps/libuuid/libtool || true - cd ../deps/libuuid/ && libtoolize - cd ../deps/libuuid/ && autoreconf - cd ../deps/libuuid/ && ./configure - cd ../deps/libuuid/ && $(MAKE) - -OBJ = ../deps/aha/aha.o ../deps/hashids/hashids.o inih/ini.o bbs.o main.o users.o main_menu.o mail_menu.o doors.o bbs_list.o chat_system.o email.o files.o settings.o lua_glue.o strings.o www.o www_email.o www_msgs.o www_last10.o bluewave.o www_files.o www_blog.o hashmap/hashmap.o menus.o os/sunos.o nodelist.o blog.o -%.o: %.c $(DEPS) - $(CC) -c -o $@ $< $(CFLAGS) - -magicka: $(OBJ) ${LUA} ${JAMLIB} ${ZMODEM} ${B64} ${JSMN} ${UUID} - $(CC) -o ../magicka $^ $(CFLAGS) -L/usr/local/lib -lsqlite3 -lm -ldl -lssl -lcrypto -lssh -lmosquitto $(MICROHTTPD) -lnsl -lsocket - -magimail: $(JAMLIB) - cd ../utils/magimail && $(MAKE) freebsd - -magiedit: $(ODOORS) - cd ../utils/magiedit && $(MAKE) -f Makefile.sunos - -ticproc: - cd ../utils/ticproc && $(MAKE) - -mgpost: $(JAMLIB) - cd ../utils/mgpost && $(MAKE) - -magichat: $(JSMN) - cd ../utils/magichat && $(MAKE) -f Makefile.sunos - -filecenter: $(CDK) - cd ../utils/filecenter && $(MAKE) - -dosbox_shim: - cd ../utils/dosbox_shim && $(MAKE) - -magiftpd: - cd ../utils/magiftpd && $(MAKE) - -reset_pass: - cd ../utils/reset_pass && $(MAKE) - -.PHONY: clean - -clean: - rm -f $(OBJ) ../magicka - cd ../deps/lua && $(MAKE) clean - cd ../deps/jamlib && $(MAKE) -f Makefile.linux clean - cd ../deps/Xmodem && $(MAKE) clean - cd ../deps/libb64-1.2 && $(MAKE) clean - cd ../utils/magimail && $(MAKE) cleanfreebsd - cd ../utils/magiedit && $(MAKE) clean - cd ../deps/odoors/ && rm -rf libs-`uname -s` objs-`uname -s` exe-`uname -s` - cd ../utils/ticproc && $(MAKE) clean - cd ../utils/mgpost && $(MAKE) clean - cd ../utils/magichat && $(MAKE) clean - cd ../deps/cdk-5.0-20161210 && $(MAKE) clean - cd ../utils/filecenter && $(MAKE) clean - cd ../utils/magiftpd && $(MAKE) clean - cd ../utils/reset_pass && $(MAKE) clean - cd ../utils/dosbox_shim && $(MAKE) clean diff --git a/utils/magichat/Makefile b/utils/magichat/GNUmakefile similarity index 65% rename from utils/magichat/Makefile rename to utils/magichat/GNUmakefile index 9fb3b91..bd4a9b7 100644 --- a/utils/magichat/Makefile +++ b/utils/magichat/GNUmakefile @@ -3,6 +3,11 @@ CC=cc DEPS = main.c OBJ = main.o + +OS = $(shell uname -s) +ifeq ($(OS), SunOS) + EXTRA_LIBS = -lsocket +endif %.o: %.c $(DEPS) $(CC) -c -o $@ $< $(CFLAGS) @@ -14,7 +19,7 @@ $(JSMN): cd ../../deps/jsmn/ && $(MAKE) magichat: $(OBJ) $(JSMN) - $(CC) -o magichat -o $@ $^ $(CFLAGS) $(LDFLAGS) + $(CC) -o magichat -o $@ $^ $(LDFLAGS) $(EXTRA_LIBS) .PHONY: clean diff --git a/utils/magichat/Makefile.sunos b/utils/magichat/Makefile.sunos deleted file mode 100644 index 8a6be9e..0000000 --- a/utils/magichat/Makefile.sunos +++ /dev/null @@ -1,22 +0,0 @@ -CC=cc - -DEPS = main.c - -OBJ = main.o -%.o: %.c $(DEPS) - $(CC) -c -o $@ $< $(CFLAGS) - -JSMN = ../../deps/jsmn/libjsmn.a - -all: magichat - -$(JSMN): - cd ../../deps/jsmn/ && $(MAKE) - -magichat: $(OBJ) $(JSMN) - $(CC) -o magichat -o $@ $^ $(CFLAGS) $(LDFLAGS) -lsocket - -.PHONY: clean - -clean: - rm -f $(OBJ) magichat diff --git a/utils/magiedit/Makefile b/utils/magiedit/GNUmakefile similarity index 57% rename from utils/magiedit/Makefile rename to utils/magiedit/GNUmakefile index 26795ca..1f77a81 100644 --- a/utils/magiedit/Makefile +++ b/utils/magiedit/GNUmakefile @@ -1,7 +1,12 @@ CC=cc CFLAGS=-I../../deps/odoors/ DEPS = main.c -ODOORS = ../../deps/odoors/libs-`uname -s`/libODoors.a +OS = $(shell uname -s) +ODOORS = ../../deps/odoors/libs-${OS}/libODoors.a + +ifeq ($(OS), SunOS) + EXTRA_LIBS = -lsocket +endif OBJ = main.o @@ -14,7 +19,7 @@ ${ODOORS}: $(CC) -c -o $@ $< $(CFLAGS) magiedit: $(OBJ) $(ODOORS) - $(CC) -o magiedit -o $@ $^ $(CFLAGS) $(ODOORS) + $(CC) -o magiedit -o $@ $^ $(CFLAGS) $(ODOORS) $(EXTRA_LIBS) .PHONY: clean diff --git a/utils/magiedit/Makefile.sunos b/utils/magiedit/Makefile.sunos deleted file mode 100644 index 800db2c..0000000 --- a/utils/magiedit/Makefile.sunos +++ /dev/null @@ -1,22 +0,0 @@ -CC=cc -CFLAGS=-I../../deps/odoors/ -DEPS = main.c -ODOORS = ../../deps/odoors/libs-`uname -s`/libODoors.a - -OBJ = main.o - -all: magiedit - -${ODOORS}: - cd ../../deps/odoors && $(MAKE) MAKEFLAGS= - -%.o: %.c $(DEPS) - $(CC) -c -o $@ $< $(CFLAGS) - -magiedit: $(OBJ) $(ODOORS) - $(CC) -o magiedit -o $@ $^ $(CFLAGS) $(ODOORS) -lsocket - -.PHONY: clean - -clean: - rm -f $(OBJ) magiedit