adding all of botlist, initial add
[botlist.git] / botlistprojects / laughingman / Makefile
blobd864ad2a45e7fc4f166f05abb5c2f8f78da71eac
1 #**********************************************************
2 # Build the .beam erlang VM files
3 # Makefile for irc bot (based on orbitz bot)
4 # Laughing man IRC library uses orbitz
6 # Date: 3/1/2008
7 # Author: Berlin Brown
9 #**********************************************************
11 TOPDIR := $(shell pwd)
12 DATE = $(shell date +%Y%m%d)
15 APPLICATION = laughingman
16 VERSION = 0.0.1
18 ESRC = ./src
19 EBIN = ./ebin
21 IRC_LIB = ./orbirclib
22 IRC_LIB_SRC = $(IRC_LIB)/src
24 TEST_DIR = ./test/erlang
25 TEST_DIR_SRC = $(TEST_DIR)/src
27 TEST_SERV_DIR = ./test/ircserver/src
28 TEST_SERV_SRC = ./test/ircserver/src
30 ERLC = erlc
31 ERL = erl
33 OPT = -W
34 INC = $(IRC_LIB)/inc
36 SED = $(shell which sed)
38 TMP = $(wildcard *~) $(wildcard src/*~) $(wildcard inc/*~)
39 INC_FILES = $(wildcard $(INC)/*.hrl)
40 SRC = $(wildcard $(ESRC)/*.erl)
41 CONFFILES = conf/config.xml $(wildcard conf/*fortune)
43 TARGET = $(addsuffix .beam, $(basename \
44 $(addprefix $(EBIN)/, $(notdir $(SRC)))))
46 LIB_TARGET_OBJS = $(EBIN)/bot_app.beam \
47 $(EBIN)/bot_manager.beam \
48 $(EBIN)/bot_supervisor.beam \
49 $(EBIN)/dcc.beam \
50 $(EBIN)/dict_proc.beam \
51 $(EBIN)/factoid_file_gen.beam \
52 $(EBIN)/irc_bot.beam \
53 $(EBIN)/irc_lib.beam \
54 $(EBIN)/irc_lookup.beam \
55 $(EBIN)/msg_dispatch.beam \
56 $(EBIN)/p1_db.beam \
57 $(EBIN)/plugin_manager.beam \
58 $(EBIN)/rec_convert.beam \
59 $(EBIN)/data_lib.beam
61 TEST_OBJS = $(EBIN)/eunit_examples.beam \
62 $(EBIN)/test_suite.beam \
63 $(EBIN)/test_parse_data.beam \
64 $(EBIN)/simple_irc_lib.beam \
65 $(EBIN)/test_simple_server.beam \
66 $(EBIN)/test_shutdown_server.beam \
68 TEST_SERVER_OBJS = $(EBIN)/server_lib.beam \
69 $(EBIN)/functional_test_server.beam \
70 $(EBIN)/client_handler.beam \
71 $(EBIN)/simple_server_example.beam \
73 ${APPLICATION}: $(TARGET) $(LIB_TARGET_OBJS) $(TEST_OBJS) $(TEST_SERVER_OBJS)
75 all: clean ${APPLICATION}
77 clean:
78 -rm -vf $(TARGET) $(TMP)
79 -rm -vf erl_crash.dump
80 -rm -vf ebin/*.beam
82 ebin/%.beam: $(IRC_LIB_SRC)/%.erl
83 $(ERLC) $(OPT) -I $(INC) -o ebin $<
85 ebin/%.beam: $(TEST_DIR_SRC)/%.erl
86 $(ERLC) $(OPT) -I $(INC) -o ebin $<
88 ebin/%.beam: $(TEST_SERV_SRC)/%.erl
89 $(ERLC) $(OPT) -I $(INC) -o ebin $<
91 ebin/%.beam: $(ESRC)/%.erl
92 $(ERLC) $(OPT) -I $(INC) -o ebin $<
94 # Start the erl emulator process with the social stats module
95 # Also -s erlang halt
96 run: $(APPLICATION)
97 $(ERL) -noshell -pa $(TOPDIR)/ebin -s laughingman start_laughingman -s erlang halt
99 # Run the test suite.
100 # Start the test IRC server, delay for 5 seconds and start the client.
101 tests: $(APPLICATION)
102 # Run the basic tests and then the server test.
103 # Ideally, test modules will have a 'run_tests' function.
104 $(ERL) -noshell -pa $(TOPDIR)/ebin -s simple_server_example simple_server_lib -s erlang halt &
105 -sleep 5
106 $(ERL) -noshell -pa $(TOPDIR)/ebin -s test_suite run_tests -s erlang halt
108 # End of the file