From fa5b233767ca9d4e012839c28eb13628d2ebba63 Mon Sep 17 00:00:00 2001 From: piaip Date: Sat, 10 Sep 2005 06:24:56 +0000 Subject: Automake is a hard work, still not working now. git-svn-id: http://opensvn.csie.org/pttbbs/branches/piaip.automake@3152 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- util/Makefile | 118 ------------------------------------------------------ util/Makefile.am | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++++ util/Makefile.old | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 232 insertions(+), 118 deletions(-) delete mode 100644 util/Makefile create mode 100644 util/Makefile.am create mode 100644 util/Makefile.old (limited to 'util') diff --git a/util/Makefile b/util/Makefile deleted file mode 100644 index cc94fdd5..00000000 --- a/util/Makefile +++ /dev/null @@ -1,118 +0,0 @@ -# $Id$ - -.include "../pttbbs.mk" - -CFLAGS+= -DPTTBBS_UTIL - -BBSBASE= ../include/var.h - -UTIL_OBJS= \ - util_cache.o util_record.o util_passwd.o util_var.o \ - util_stuff.o util_osdep.o util_args.o util_file.o \ - util_crypt.o - -MBBSD_OBJS= \ - cache record passwd var \ - stuff osdep args file \ - crypt - -# 下面這些程式, 會被 compile 並且和 $(UTIL_OBJS) 聯結 -CPROG_WITH_UTIL= \ - boardlist BM_money post poststat \ - jungo account birth deluserfile \ - expire mandex rmuid horoscope \ - openvice parse_news openticket topusr \ - yearsold toplazyBM toplazyBBM writemoney \ - reaper buildAnnounce inndBM mailangel \ - outmail chkhbf checkmoney merge_dir \ - transman angel gamblegive checkdir \ - chesscountry tunepasswd buildir xchatd - -# 下面這些程式, 會直接被 compile -CPROG_WITHOUT_UTIL= \ - uhash_loader showboard \ - countalldice bbsrf initbbs \ - userlist merge_passwd \ - merge_board bbsmail gamble_fix - -# 下面這些程式會被 install -PROGS= ${CPROG_WITH_UTIL} ${CPROG_WITHOUT_UTIL} \ - shmctl \ - BM_money.sh backpasswd.sh mailog.sh opendice.sh \ - openticket.sh stock.sh topsong.sh weather.sh \ - stock.perl weather.perl toplazyBM.sh toplazyBBM.sh \ - dailybackup.pl tarqueue.pl waterball.pl filtermail.pl \ - getbackup.pl udnnews.pl rebuildaloha.pl - -all: ${CPROG_WITH_UTIL} ${CPROG_WITHOUT_UTIL} ${PROGS} - -../include/var.h: ../mbbsd/var.c - cd ../mbbsd; $(MAKE) ../include/var.h - -.for fn in ${CPROG_WITH_UTIL} -${fn}: ${BBSBASE} ${fn}.c ${UTIL_OBJS} - $(CCACHE) ${CC} ${CFLAGS} ${LDFLAGS} -o ${fn} ${UTIL_OBJS} ${fn}.c -.endfor - -.for fn in ${MBBSD_OBJS} -util_${fn}.o: ${BBSBASE} ../mbbsd/${fn}.c - $(CCACHE) ${CC} ${CFLAGS} -D_BBS_UTIL_C_ -c -o $@ ../mbbsd/${fn}.c -.endfor - -shmctl: ${BBSBASE} shmctl.c ${UTIL_OBJS} - $(CCACHE) ${CC} ${CFLAGS} ${LDFLAGS} -o shmctl ${UTIL_OBJS} shmctl.c -#shmctl: ${BBSBASE} shmctl.c ${UTIL_OBJS} -# $(CCACHE) gcc -g -DBBSHOME='"/home/bbs"' -I../include -D__OS_MAJOR_VERSION__="2" -D__OS_MINOR_VERSION__="6" -DPTTBBS_UTIL -O1 -o shmctl ${UTIL_OBJS} shmctl.c -#shmctl: ${BBSBASE} shmctl.cc ${UTIL_OBJS} -# $(CCACHE) g++ -g -DBBSHOME='"/home/bbs"' -I../include -D__OS_MAJOR_VERSION__="2" -D__OS_MINOR_VERSION__="6" -DPTTBBS_UTIL -O1 -o shmctl ${UTIL_OBJS} shmctl.cc - -bbsmail: ${BBSBASE} bbsmail.c ../innbbsd/str_decode.c $(UTIL_OBJS) - $(CCACHE) $(CC) $(CFLAGS) $(LDFLAGS) -o bbsmail -DUSE_ICONV \ - bbsmail.c ../innbbsd/str_decode.c $(UTIL_OBJS) - -install: $(PROGS) - install -d $(BBSHOME)/bin/ - install -c -m 755 $(PROGS) $(BBSHOME)/bin/ - chmod 4755 $(BBSHOME)/bin/post -.if defined(WITHFILTERMAIL) - $(MAKE) installfiltermail -.endif - -clean: - rm -f *.o $(CPROGS) $(CPROG_WITH_UTIL) $(CPROG_WITHOUT_UTIL) - - -installfiltermail: - mv $(BBSHOME)/bin/bbsmail $(BBSHOME)/bin/realbbsmail - ln -s $(BBSHOME)/bin/filtermail.pl $(BBSHOME)/bin/bbsmail - -# for diskstat(FreeBSD 4.x only) . -# diskstat should be compiled with bbs and installed with root -diskstat: diskstat.c - $(CCACHE) $(CC) $(CFLAGS) -o diskstat diskstat.c -ldevstat -lkvm - -installdiskstat: diskstat - cp -f diskstat /usr/local/bin/ - chgrp kmem /usr/local/bin/diskstat - chmod 2755 /usr/local/bin/diskstat - -# for bbsctl. bbsctl should be compiled with bbs and installed with root -bbsctl: bbsctl.c - $(CCACHE) $(CC) $(CFLAGS) -o $@ $@.c - -installbbsctl: bbsctl - rm -f /home/bbs/bin/bbsctl - cp /home/bbs/pttbbs/util/bbsctl /home/bbs/bin/bbsctl - chown root /home/bbs/bin/bbsctl - chmod 4755 /home/bbs/bin/bbsctl - -cleanpasswd: cleanpasswd.c ${UTIL_OBJS} - $(CCACHE) ${CC} ${CFLAGS} ${LDFLAGS} -o cleanpasswd ${UTIL_OBJS} cleanpasswd.c - -r2014transfer: r2014convert - $(CCACHE) ${CC} ${CFLAGS} ${LDFLAGS} -o r2014convert r2014convert.c - ./r2014convert - rm r2014convert - -passwdconverter: passwdconverter.c - $(CCACHE) $(CC) $(CFLAGS) $(LDFLAGS) $(UTIL_OBJS) -o passwdconverter passwdconverter.c diff --git a/util/Makefile.am b/util/Makefile.am new file mode 100644 index 00000000..f1cdf95d --- /dev/null +++ b/util/Makefile.am @@ -0,0 +1,114 @@ +######################################################################## +# PTT BBS Automake +# Create: piaip, Sat Sep 10 10:36:56 CST 2005 +######################################################################## +# $Id$ + +CFLAGS=-DPTTBBS_UTIL +BBSBASE=../include/var.h + +# Compile and build with BBS utility library. +CPROG_WITH_UTIL= \ + boardlist BM_money post poststat \ + jungo account birth deluserfile \ + expire mandex rmuid horoscope \ + openvice parse_news openticket topusr \ + yearsold toplazyBM toplazyBBM writemoney \ + reaper buildAnnounce inndBM mailangel \ + outmail chkhbf checkmoney merge_dir \ + transman angel gamblegive checkdir \ + chesscountry tunepasswd buildir xchatd + +# Compile directly. +CPROG_WITHOUT_UTIL= \ + countalldice bbsrf bbsmail initbbs \ + gamble_fix merge_board merge_passwd showboard \ + userlist uhash_loader + +# No need to be compiled. +SCRIPT_PROG = \ + BM_money.sh backpasswd.sh mailog.sh opendice.sh \ + openticket.sh stock.sh topsong.sh weather.sh \ + stock.perl weather.perl toplazyBM.sh toplazyBBM.sh \ + dailybackup.pl tarqueue.pl waterball.pl filtermail.pl \ + getbackup.pl udnnews.pl rebuildaloha.pl + +bin_PRORAMS=$(SCRIPT_PROG) $(CPROG_WITHOUT_UTIL) $(CPROG_WITH_UTIL) \ + shmctl + +UTIL_LIB= \ + util_cache.c util_record.c util_passwd.c util_var.c \ + util_stuff.c util_osdep.c util_args.c util_file.c \ + util_crypt.c + +MBBSD_OBJS= \ + cache record passwd var \ + stuff osdep args file \ + crypt + +../include/var.h: ../mbbsd/var.c + cd ../mbbsd; $(MAKE) ../include/var.h + +.for fn in ${CPROG_WITH_UTIL} +${fn}: ${BBSBASE} ${fn}.c ${UTIL_OBJS} + $(CCACHE) ${CC} ${CFLAGS} ${LDFLAGS} -o ${fn} ${UTIL_OBJS} ${fn}.c +.endfor + +.for fn in ${MBBSD_OBJS} +util_${fn}.o: ${BBSBASE} ../mbbsd/${fn}.c + $(CCACHE) ${CC} ${CFLAGS} -D_BBS_UTIL_C_ -c -o $@ ../mbbsd/${fn}.c +.endfor + +shmctl: ${BBSBASE} shmctl.c ${UTIL_OBJS} + $(CCACHE) ${CC} ${CFLAGS} ${LDFLAGS} -o shmctl ${UTIL_OBJS} shmctl.c + +bbsmail: ${BBSBASE} bbsmail.c ../innbbsd/str_decode.c $(UTIL_OBJS) + $(CCACHE) $(CC) $(CFLAGS) $(LDFLAGS) -o bbsmail -DUSE_ICONV \ + bbsmail.c ../innbbsd/str_decode.c $(UTIL_OBJS) + +install: $(PROGS) + install -d $(BBSHOME)/bin/ + install -c -m 755 $(PROGS) $(BBSHOME)/bin/ + chmod 4755 $(BBSHOME)/bin/post +.if defined(WITHFILTERMAIL) + $(MAKE) installfiltermail +.endif + +clean: + rm -f *.o $(CPROGS) $(CPROG_WITH_UTIL) $(CPROG_WITHOUT_UTIL) + + +installfiltermail: + mv $(BBSHOME)/bin/bbsmail $(BBSHOME)/bin/realbbsmail + ln -s $(BBSHOME)/bin/filtermail.pl $(BBSHOME)/bin/bbsmail + +# for diskstat(FreeBSD 4.x only) . +# diskstat should be compiled with bbs and installed with root +diskstat: diskstat.c + $(CCACHE) $(CC) $(CFLAGS) -o diskstat diskstat.c -ldevstat -lkvm + +installdiskstat: diskstat + cp -f diskstat /usr/local/bin/ + chgrp kmem /usr/local/bin/diskstat + chmod 2755 /usr/local/bin/diskstat + +# for bbsctl. bbsctl should be compiled with bbs and installed with root +bbsctl: bbsctl.c + $(CCACHE) $(CC) $(CFLAGS) -o $@ $@.c + +installbbsctl: bbsctl + rm -f /home/bbs/bin/bbsctl + cp /home/bbs/pttbbs/util/bbsctl /home/bbs/bin/bbsctl + chown root /home/bbs/bin/bbsctl + chmod 4755 /home/bbs/bin/bbsctl + +cleanpasswd: cleanpasswd.c ${UTIL_OBJS} + $(CCACHE) ${CC} ${CFLAGS} ${LDFLAGS} -o cleanpasswd ${UTIL_OBJS} cleanpasswd.c + +r2014transfer: r2014convert + $(CCACHE) ${CC} ${CFLAGS} ${LDFLAGS} -o r2014convert r2014convert.c + ./r2014convert + rm r2014convert + +passwdconverter: passwdconverter.c + $(CCACHE) $(CC) $(CFLAGS) $(LDFLAGS) $(UTIL_OBJS) -o passwdconverter passwdconverter.c diff --git a/util/Makefile.old b/util/Makefile.old new file mode 100644 index 00000000..cc94fdd5 --- /dev/null +++ b/util/Makefile.old @@ -0,0 +1,118 @@ +# $Id$ + +.include "../pttbbs.mk" + +CFLAGS+= -DPTTBBS_UTIL + +BBSBASE= ../include/var.h + +UTIL_OBJS= \ + util_cache.o util_record.o util_passwd.o util_var.o \ + util_stuff.o util_osdep.o util_args.o util_file.o \ + util_crypt.o + +MBBSD_OBJS= \ + cache record passwd var \ + stuff osdep args file \ + crypt + +# 下面這些程式, 會被 compile 並且和 $(UTIL_OBJS) 聯結 +CPROG_WITH_UTIL= \ + boardlist BM_money post poststat \ + jungo account birth deluserfile \ + expire mandex rmuid horoscope \ + openvice parse_news openticket topusr \ + yearsold toplazyBM toplazyBBM writemoney \ + reaper buildAnnounce inndBM mailangel \ + outmail chkhbf checkmoney merge_dir \ + transman angel gamblegive checkdir \ + chesscountry tunepasswd buildir xchatd + +# 下面這些程式, 會直接被 compile +CPROG_WITHOUT_UTIL= \ + uhash_loader showboard \ + countalldice bbsrf initbbs \ + userlist merge_passwd \ + merge_board bbsmail gamble_fix + +# 下面這些程式會被 install +PROGS= ${CPROG_WITH_UTIL} ${CPROG_WITHOUT_UTIL} \ + shmctl \ + BM_money.sh backpasswd.sh mailog.sh opendice.sh \ + openticket.sh stock.sh topsong.sh weather.sh \ + stock.perl weather.perl toplazyBM.sh toplazyBBM.sh \ + dailybackup.pl tarqueue.pl waterball.pl filtermail.pl \ + getbackup.pl udnnews.pl rebuildaloha.pl + +all: ${CPROG_WITH_UTIL} ${CPROG_WITHOUT_UTIL} ${PROGS} + +../include/var.h: ../mbbsd/var.c + cd ../mbbsd; $(MAKE) ../include/var.h + +.for fn in ${CPROG_WITH_UTIL} +${fn}: ${BBSBASE} ${fn}.c ${UTIL_OBJS} + $(CCACHE) ${CC} ${CFLAGS} ${LDFLAGS} -o ${fn} ${UTIL_OBJS} ${fn}.c +.endfor + +.for fn in ${MBBSD_OBJS} +util_${fn}.o: ${BBSBASE} ../mbbsd/${fn}.c + $(CCACHE) ${CC} ${CFLAGS} -D_BBS_UTIL_C_ -c -o $@ ../mbbsd/${fn}.c +.endfor + +shmctl: ${BBSBASE} shmctl.c ${UTIL_OBJS} + $(CCACHE) ${CC} ${CFLAGS} ${LDFLAGS} -o shmctl ${UTIL_OBJS} shmctl.c +#shmctl: ${BBSBASE} shmctl.c ${UTIL_OBJS} +# $(CCACHE) gcc -g -DBBSHOME='"/home/bbs"' -I../include -D__OS_MAJOR_VERSION__="2" -D__OS_MINOR_VERSION__="6" -DPTTBBS_UTIL -O1 -o shmctl ${UTIL_OBJS} shmctl.c +#shmctl: ${BBSBASE} shmctl.cc ${UTIL_OBJS} +# $(CCACHE) g++ -g -DBBSHOME='"/home/bbs"' -I../include -D__OS_MAJOR_VERSION__="2" -D__OS_MINOR_VERSION__="6" -DPTTBBS_UTIL -O1 -o shmctl ${UTIL_OBJS} shmctl.cc + +bbsmail: ${BBSBASE} bbsmail.c ../innbbsd/str_decode.c $(UTIL_OBJS) + $(CCACHE) $(CC) $(CFLAGS) $(LDFLAGS) -o bbsmail -DUSE_ICONV \ + bbsmail.c ../innbbsd/str_decode.c $(UTIL_OBJS) + +install: $(PROGS) + install -d $(BBSHOME)/bin/ + install -c -m 755 $(PROGS) $(BBSHOME)/bin/ + chmod 4755 $(BBSHOME)/bin/post +.if defined(WITHFILTERMAIL) + $(MAKE) installfiltermail +.endif + +clean: + rm -f *.o $(CPROGS) $(CPROG_WITH_UTIL) $(CPROG_WITHOUT_UTIL) + + +installfiltermail: + mv $(BBSHOME)/bin/bbsmail $(BBSHOME)/bin/realbbsmail + ln -s $(BBSHOME)/bin/filtermail.pl $(BBSHOME)/bin/bbsmail + +# for diskstat(FreeBSD 4.x only) . +# diskstat should be compiled with bbs and installed with root +diskstat: diskstat.c + $(CCACHE) $(CC) $(CFLAGS) -o diskstat diskstat.c -ldevstat -lkvm + +installdiskstat: diskstat + cp -f diskstat /usr/local/bin/ + chgrp kmem /usr/local/bin/diskstat + chmod 2755 /usr/local/bin/diskstat + +# for bbsctl. bbsctl should be compiled with bbs and installed with root +bbsctl: bbsctl.c + $(CCACHE) $(CC) $(CFLAGS) -o $@ $@.c + +installbbsctl: bbsctl + rm -f /home/bbs/bin/bbsctl + cp /home/bbs/pttbbs/util/bbsctl /home/bbs/bin/bbsctl + chown root /home/bbs/bin/bbsctl + chmod 4755 /home/bbs/bin/bbsctl + +cleanpasswd: cleanpasswd.c ${UTIL_OBJS} + $(CCACHE) ${CC} ${CFLAGS} ${LDFLAGS} -o cleanpasswd ${UTIL_OBJS} cleanpasswd.c + +r2014transfer: r2014convert + $(CCACHE) ${CC} ${CFLAGS} ${LDFLAGS} -o r2014convert r2014convert.c + ./r2014convert + rm r2014convert + +passwdconverter: passwdconverter.c + $(CCACHE) $(CC) $(CFLAGS) $(LDFLAGS) $(UTIL_OBJS) -o passwdconverter passwdconverter.c -- cgit v1.2.3