aboutsummaryrefslogtreecommitdiffstats
path: root/modules/test/Makefile
diff options
context:
space:
mode:
authorTom Feist <shabble@metavore.org>2011-01-01 17:38:55 +0000
committerTom Feist <shabble@metavore.org>2011-01-01 17:38:55 +0000
commitfc84e55acd28bb7da2d104c0cd9a7487f261b7b5 (patch)
tree3609741634da3db93d7889ea30d29054af852e18 /modules/test/Makefile
parentMerge branch 'dev' of github.com:shabble/irssi-scripts into dev (diff)
downloadirssi-scripts-fc84e55acd28bb7da2d104c0cd9a7487f261b7b5.tar.gz
irssi-scripts-fc84e55acd28bb7da2d104c0cd9a7487f261b7b5.zip
module_test: The tiny beginnings of an irssi loadable-module (not script) for
educational and internals poking purposes. Hopefully one day it might grow up to be a real binary! See README for details on the code I "borrowed" from ahf. I hope I attributed it all ok :)
Diffstat (limited to 'modules/test/Makefile')
-rw-r--r--modules/test/Makefile45
1 files changed, 45 insertions, 0 deletions
diff --git a/modules/test/Makefile b/modules/test/Makefile
new file mode 100644
index 0000000..8ba234d
--- /dev/null
+++ b/modules/test/Makefile
@@ -0,0 +1,45 @@
+CFLAGS = -Wall -O2 -Werror -g
+LDFLAGS = -avoid-version -module -bundle -flat_namespace -undefined suppress
+FIND = gfind # stupid non-gnu defaults.
+
+OBJECTS = test_core.o \
+ test_impl.o
+
+
+IRSSI_DIST = /opt/stow/repo/irssi/include/irssi
+
+IRSSI_USER_DIR = $(HOME)/projects/tmp/test/irssi
+
+IRSSI_INCLUDE = -I$(IRSSI_DIST) \
+ -I$(IRSSI_DIST)/src \
+ -I$(IRSSI_DIST)/src/fe-common/core \
+ -I$(IRSSI_DIST)/src/core \
+ -I$(IRSSI_DIST)/src/fe-text \
+ -I$(IRSSI_DIST)/src/irc \
+ -I$(IRSSI_DIST)/src/irc/core \
+ -I$(IRSSI_DIST)/src/irc/dcc \
+ -I$(IRSSI_DIST)/src/irc/notifylist
+
+
+GLIB_CFLAGS = $(shell pkg-config glib-2.0 --cflags)
+
+all: libtest.so
+
+%.o: %.c Makefile
+ $(CC) $(CFLAGS) $(GLIB_CFLAGS) $(IRSSI_INCLUDE) -I. -fPIC -c $<
+
+libtest.so: $(OBJECTS)
+ $(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) -o $@
+
+install: libtest.so
+ install $< $(IRSSI_USER_DIR)/modules
+
+clean:
+ rm -rf *~ *.o *.so core || true
+
+TAGS:
+ $(FIND) -type f -exec etags -a -o TAGS {} \;
+
+.default: all
+
+.phony: clean install TAGS