aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 16 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 62c42db..e0956f8 100644
--- a/Makefile
+++ b/Makefile
@@ -4,15 +4,26 @@ GIT_VERSION := $(shell [ -d .git ] && echo "-$$(git describe --always)")
CFLAGS ?= -g
CFLAGS += -DVERSION=\"$(VERSION)$(GIT_VERSION)\"
-all: sircbot
+TARGETS = sircbot sircbot-send
-sircbot_OBJ = sircbot.o irc.o
+ifneq (NOLUA,)
+TARGETS += sircbot.so
+LUA_LIBS=-llua
+endif
-sircbot: $(sircbot_OBJ)
+all: $(TARGETS)
+
+sircbot: sircbot.o irc.o
+ $(CC) $(LDFLAGS) -o $@ $^
+
+sircbot-send: sircbot-send.o
$(CC) $(LDFLAGS) -o $@ $^
+sircbot.so: lsircbot.o
+ $(CC) -shared $(LDFLAGS) -o $@ $^ $(LUA_LIBS)
+
.c.o:
- $(CC) $(CFLAGS) -c $^
+ $(CC) -fPIC $(CFLAGS) -c $^
clean:
- rm -rf sircbot $(sircbot_OBJ)
+ rm -f *.o $(TARGETS)