home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / java / in4wjcxu / other / irc / ircd / makefile < prev    next >
Encoding:
Makefile  |  1996-08-14  |  9.9 KB  |  269 lines

  1. #************************************************************************
  2. #*   IRC - Internet Relay Chat, ircd/Makefile
  3. #*   Copyright (C) 1990 Jarkko Oikarinen
  4. #*
  5. #*   This program is free software; you can redistribute it and/or modify
  6. #*   it under the terms of the GNU General Public License as published by
  7. #*   the Free Software Foundation; either version 1, or (at your option)
  8. #*   any later version.
  9. #*
  10. #*   This program is distributed in the hope that it will be useful,
  11. #*   but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. #*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. #*   GNU General Public License for more details.
  14. #*
  15. #*   You should have received a copy of the GNU General Public License
  16. #*   along with this program; if not, write to the Free Software
  17. #*   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. #*/
  19.  
  20. CC=gcc
  21. RM=/bin/rm
  22. CP=/bin/cp
  23. TOUCH=touch
  24. SHELL=/bin/sh
  25. INSTALL=/usr/bin/install
  26.  
  27. # IRCDMODE given in top level Makefile, but added here to make sure
  28. # compilation works if started in ircd subdirectory
  29.  
  30. IRCDMODE=711
  31. INCLUDEDIR=../include
  32.  
  33. # CFLAGS/IRCDLIBS used in ../Makefile should also be used here.  The list
  34. # given below is less than complete.
  35. # For MIPS, use the following:
  36. #CFLAGS= -g -systype bsd43 -DSYSTYPE_BSD43 -I${INCLUDEDIR}
  37. # For Irix 4.x (SGI), use the following:
  38. #CFLAGS= -g -cckr -I$(INCLUDEDIR)
  39. # else just this
  40. CFLAGS= -g -I${INCLUDEDIR}
  41. #
  42. # use the following on SUN OS without nameserver libraries inside libc
  43. # NOTE: most dont have the resolver libraries inside libc
  44. #IRCDLIBS=-lresolv
  45. #
  46. #on NeXT other than 2.0:
  47. #IRCDLIBS=-lsys_s
  48. #
  49. # HPUX:
  50. #IRCDLIBS=-lBSD
  51. #
  52. # Solaris 2
  53. IRCDLIBS=-lsocket -lnsl -lresolv
  54. #
  55. # ESIX
  56. #CFLAGS=-O -I${INCLUDEDIR} -I/usr/ucbinclude
  57. #IRCDLIBS=-L/usr/ucblib -L/usr/lib -lsocket -lucb -lns -lnsl
  58. #
  59. #When profiling:
  60. #IRCDLIBS=-lc_p
  61.  
  62. LINTFLAGS=-hba
  63. #
  64. # LDFLAGS - flags to send the loader (ld). SunOS users may want to add
  65. # -Bstatic here.
  66. #
  67. #LDFLAGS=-Bstatic
  68. #LDFLAGS=-Wl,-a,archive
  69. #
  70. # RES - if you are missing the resolv library (man 5 resolv.conf), or you
  71. # experience probems with ip# to hostname lookups for local machines or
  72. # the server wont compile because _res is missing, uncomment RES.
  73. # For those who know what these are, if you normally use the resolv+
  74. # libraries and have setup /etc/resolv.conf, these are fromm resolv+ if they
  75. # are not part of your system libraries.  In all cases you should try your
  76. # system libraries before these.
  77. #
  78. #RES=res_init.o res_comp.o res_mkquery.o
  79.  
  80. COMMONOBJS=../common/bsd.o ../common/dbuf.o ../common/packet.o \
  81.            ../common/send.o ../common/match.o ../common/parse.o \
  82.            ../common/support.o
  83.  
  84. OBJS=channel.o class.o hash.o ircd.o list.o res.o s_auth.o s_bsd.o s_conf.o \
  85.     s_debug.o s_err.o s_misc.o s_numeric.o s_serv.o s_user.o whowas.o \
  86.     note.o $(RES) $(COMMONOBJS)
  87.  
  88. SRC=$(OBJS:%.o=%.c)
  89.  
  90. COMMONSRC=$(COMMONOBJS:%.o=%.c)
  91.  
  92. MAKE = make 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'IRCDLIBS=${IRCDLIBS}' \
  93.         'LDFLAGS=${LDFLAGS}' 'IRCDMODE=${IRCDMODE}'
  94.  
  95.  
  96. all: build
  97.  
  98. build: ircd chkconf
  99.  
  100. ircd: $(OBJS) ../include/patchlevel.h
  101.     $(SHELL) version.c.SH
  102.     $(CC) $(CFLAGS) -c version.c
  103.     $(CC) $(CFLAGS) $(OBJS) version.o $(LDFLAGS) $(IRCDLIBS) -o ircd
  104.     chmod $(IRCDMODE) ircd
  105.  
  106. chkconf: ../include/struct.h ../include/config.h ../include/sys.h \
  107.      ../include/common.h chkconf.c
  108.     $(CC) $(CFLAGS) chkconf.c ../common/match.o \
  109.     $(LDFLAGS) $(IRCDLIBS) -o chkconf
  110.  
  111. saber: $(SRC)
  112.     #load -I../include $(SRC) $(COMMONSRC) version.c $(IRCDLIBS)
  113.  
  114. lint:
  115.     lint $(LINTFLAGS) -I../include $(SRC) | egrep -v 'sendto_|debug'
  116.  
  117. ../common/parse.o: ../common/parse.c ../include/msg.h ../include/config.h\
  118.            ../include/struct.h ../include/sys.h ../include/numeric.h
  119.     (cd ../common; $(MAKE) build);
  120. ../common/bsd.o: ../common/bsd.c ../include/config.h ../include/common.h\
  121.          ../include/struct.h ../include/sys.h
  122.     (cd ../common; $(MAKE) build);
  123. ../common/dbuf.o: ../common/dbuf.c ../include/config.h ../include/common.h\
  124.           ../include/struct.h ../include/dbuf.h
  125.     (cd ../common; $(MAKE) build);
  126. ../common/packet.o: ../common/packet.c ../include/config.h ../include/common.h\
  127.             ../include/struct.h ../include/msg.h
  128.     (cd ../common; $(MAKE) build);
  129. ../common/send.o: ../common/send.c ../include/config.h ../include/common.h\
  130.           ../include/struct.h ../include/sys.h
  131.     (cd ../common; $(MAKE) build);
  132. ../common/match.o: ../common/match.c ../include/config.h ../include/common.h\
  133.            ../include/sys.h
  134.     (cd ../common; $(MAKE) build);
  135. ../common/support.o: ../common/support.c ../include/config.h ../include/sys.h\
  136.              ../include/common.h
  137.     (cd ../common; $(MAKE) build);
  138.  
  139. install: all
  140.     -if [ ! -d ${IRCDDIR} -a ! -f ${IRCDDIR} ] ; then \
  141.         mkdir ${IRCDDIR}; \
  142.     fi
  143.     ../bsdinstall -c -s -m ${IRCDMODE} ircd ${BINDIR}
  144.     ../bsdinstall -c -s -m 700 chkconf ${BINDIR}
  145.     $(CP) ../doc/example.conf ${IRCDDIR}
  146.     $(TOUCH) ${IRCDDIR}/ircd.motd
  147.     $(RM) -f ${IRCDDIR}/ircd.m4
  148.     $(TOUCH) ${IRCDDIR}/ircd.m4
  149.     chmod +x buildm4
  150.     ./buildm4 ${IRCDDIR}
  151.  
  152. clean:
  153.     $(RM) -f *.o *~ core ircd version.c \#* *.bak chkconf
  154.  
  155. depend:
  156.     makedepend -I${INCLUDEDIR} ${SRC}
  157.  
  158. channel.o: ../include/struct.h ../include/config.h ../include/dbuf.h \
  159.        ../include/numeric.h ../include/channel.h ../include/sys.h \
  160.        ../include/common.h
  161.     $(CC) $(CFLAGS) -c channel.c
  162.  
  163. class.o: ../include/struct.h ../include/class.h ../include/numeric.h \
  164.      ../include/common.h ../include/config.h ../include/sys.h
  165.     $(CC) $(CFLAGS) -c class.c
  166.  
  167. ircd.o: ircd.c ../include/struct.h ../include/config.h ../include/sys.h \
  168.     ../include/dbuf.h ../include/numeric.h ../include/common.h
  169.     $(CC) $(CFLAGS) -c ircd.c
  170.  
  171. list.o: list.c ../include/struct.h ../include/config.h ../include/dbuf.h \
  172.     ../include/sys.h ../include/common.h
  173.     $(CC) $(CFLAGS) -c list.c
  174.  
  175. res.o: res.c ../include/struct.h ../include/config.h ../include/res.h \
  176.        ../include/sys.h ../include/common.h
  177.     $(CC) $(CFLAGS) -c res.c
  178.  
  179. s_bsd.o: s_bsd.c ../include/struct.h ../include/config.h ../include/dbuf.h \
  180.      ../include/sys.h ../include/common.h
  181.     $(CC) $(CFLAGS) -c s_bsd.c
  182.  
  183. s_auth.o: s_auth.c ../include/struct.h ../include/config.h ../include/dbuf.h \
  184.       ../include/sys.h ../include/common.h
  185.     $(CC) $(CFLAGS) -c s_auth.c
  186.  
  187. s_conf.o: s_conf.c ../include/struct.h ../include/config.h ../include/sys.h \
  188.       ../include/common.h ../include/numeric.h  ../include/dbuf.h
  189.     $(CC) $(CFLAGS) -c s_conf.c
  190.  
  191. s_debug.o: ../include/config.h ../include/struct.h ../include/common.h \
  192.       ../include/sys.h s_debug.c
  193.     $(CC) $(CFLAGS) -c s_debug.c
  194.  
  195. s_err.o: ../include/config.h ../include/struct.h ../include/common.h \
  196.       ../include/sys.h ../include/numeric.h ../include/msg.h s_err.c
  197.     $(CC) $(CFLAGS) -c s_err.c
  198.  
  199. s_misc.o: s_misc.c ../include/struct.h ../include/config.h ../include/dbuf.h \
  200.       ../include/common.h ../include/sys.h ../include/numeric.h
  201.     $(CC) $(CFLAGS) -c s_misc.c
  202.  
  203. s_user.o: s_user.c ../include/struct.h ../include/config.h ../include/sys.h \
  204.       ../include/common.h ../include/dbuf.h ../include/channel.h \
  205.       ../include/msg.h ../include/numeric.h ../include/whowas.h
  206.     $(CC) $(CFLAGS) -c s_user.c
  207.  
  208. s_serv.o: s_serv.c ../include/struct.h ../include/config.h ../include/sys.h \
  209.       ../include/common.h ../include/dbuf.h ../include/channel.h \
  210.       ../include/msg.h ../include/numeric.h ../include/whowas.h
  211.     $(CC) $(CFLAGS) -c s_serv.c
  212.  
  213. s_numeric.o: s_numeric.c ../include/config.h ../include/sys.h \
  214.       ../include/common.h ../include/struct.h ../include/dbuf.h \
  215.       ../include/numeric.h
  216.     $(CC) $(CFLAGS) -c s_numeric.c
  217.  
  218. whowas.o: ../include/struct.h ../include/config.h ../include/sys.h \
  219.       ../include/common.h ../include/dbuf.h ../include/numeric.h \
  220.       ../include/whowas.h whowas.c
  221.     $(CC) $(CFLAGS) -c whowas.c
  222.  
  223. hash.o: ../include/struct.h ../include/sys.h ../include/hash.h hash.c \
  224.     ../include/common.h ../include/config.h s_bsd.c s_serv.c s_user.c \
  225.     channel.c s_misc.c
  226.     @crypt/sums
  227.     $(CC) $(CFLAGS) -c hash.c
  228.     @/bin/rm -f hash.c
  229.     @/bin/mv -f hash.c.old hash.c
  230.     @touch hash.o
  231.  
  232. # DO NOT DELETE THIS LINE -- make depend depends on it.
  233.  
  234. channel.o: ../include/struct.h ../include/config.h ../include/dbuf.h
  235. channel.o: ../include/numeric.h ../include/channel.h channel.c
  236. s_misc.o: ../include/struct.h ../include/config.h ../include/dbuf.h s_misc.c
  237. ircd.o: ../include/struct.h ../include/config.h
  238. ircd.o: ../include/dbuf.h ../include/numeric.h ircd.c
  239. list.o: ../include/struct.h ../include/config.h ../include/dbuf.h
  240. list.o: ../include/sys.h list.c
  241. res.o: ../include/struct.h ../include/config.h ../include/res.h res.c
  242. s_bsd.o: ../include/struct.h ../include/config.h ../include/dbuf.h
  243. s_bsd.o: ../include/sys.h s_bsd.c
  244. s_auth.o: ../include/struct.h ../include/config.h ../include/dbuf.h
  245. s_auth.o: ../include/sys.h s_auth.c
  246. s_debug.o: ../include/config.h ../include/struct.h ../include/common.h
  247. s_debug.o: ../include/sys.h s_debug.c
  248. s_debug.o: ../include/struct.h ../include/common.h ../include/sys.h
  249. s_err.o: ../include/struct.h ../include/config.h ../include/numeric.h
  250. s_err.o: ../include/dbuf.h ../include/sys.h s_err.c
  251. s_conf.o: ../include/struct.h ../include/config.h ../include/numeric.h
  252. s_conf.o: ../include/dbuf.h ../include/sys.h s_conf.c
  253. s_user.o: ../include/struct.h ../include/config.h
  254. s_user.o: ../include/dbuf.h ../include/sys.h ../include/channel.h
  255. s_user.o: ../include/msg.h ../include/numeric.h ../include/whowas.h s_user.c
  256. s_serv.o: ../include/struct.h ../include/config.h
  257. s_serv.o: ../include/dbuf.h ../include/sys.h ../include/channel.h
  258. s_serv.o: ../include/msg.h ../include/numeric.h ../include/whowas.h s_serv.c
  259. s_numeric.o: ../include/config.h ../include/sys.h ../include/struct.h
  260. s_numeric.o: ../include/dbuf.h ../include/numeric.h s_numeric.c
  261. whowas.o: ../include/struct.h ../include/config.h ../include/dbuf.h
  262. whowas.o: ../include/numeric.h ../include/whowas.h ../include/sys.h whowas.c
  263. class.o: ../include/struct.h ../include/class.h ../include/numeric.h
  264. class.o: ../include/common.h ../include/config.h class.c
  265. hash.o: ../include/config.h ../include/sys.h ../include/hash.h
  266. hash.o: ../include/struct.h ../include/common.h s_serv.c s_user.c
  267. hash.o: channel.c s_misc.c s_bsd.c ircd.c hash.c version.c.SH
  268. version.o: version.c.SH version.c
  269.