From 2b86c851562f86f69acbf4b773107077680d5068 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Fri, 7 Apr 2017 23:59:03 +0200 Subject: Push weechat plugin --- weechat/Makefile | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 weechat/Makefile (limited to 'weechat/Makefile') diff --git a/weechat/Makefile b/weechat/Makefile new file mode 100644 index 0000000..0973efe --- /dev/null +++ b/weechat/Makefile @@ -0,0 +1,40 @@ +CC = gcc +CFLAGS = -Wall -Wextra -std=c11 -fwrapv -g -O2 -fPIC + +SRC_FILES = $(wildcard *.c) +HEADER_FILES = $(wildcard *.h) +OBJECT_FILES = $(patsubst %.c,%.o,$(SRC_FILES)) + +UNAME = $(shell uname) + +ifeq ($(UNAME),Darwin) + DYLIB_EXT = so # should really be .dylib, but weechat seems to expect 'so' + DYLIB_FLAGS = -dynamiclib +else + DYLIB_EXT = so + DYLIB_FLAGS = -shared +endif + + +# Don't remove intermediate files +.SECONDARY: + + +.PHONY: all clean remake dynamiclib + +all: dynamiclib + +clean: + rm -f *.$(DYLIB_EXT) *.o + +remake: clean + $(MAKE) all + +dynamiclib: tomsg.$(DYLIB_EXT) + + +%.o: %.c $(HEADER_FILES) + $(CC) $(CFLAGS) -c -o $@ $< + +%.$(DYLIB_EXT): $(OBJECT_FILES) + $(CC) $(CFLAGS) $(DYLIB_FLAGS) -o $@ $^ -- cgit v1.2.3-70-g09d2