aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-04-16 19:00:01 +0200
committerMattias Andrée <maandree@operamail.com>2015-04-16 19:00:01 +0200
commitddecadefedd25f7f2d2c91e4a8f9607f5c5c2d94 (patch)
tree7520bde7cc465317e9790b69109cb16ef8cd49a1 /Makefile
parentm + busname generation (diff)
downloadbus-ddecadefedd25f7f2d2c91e4a8f9607f5c5c2d94.tar.gz
bus-ddecadefedd25f7f2d2c91e4a8f9607f5c5c2d94.tar.bz2
bus-ddecadefedd25f7f2d2c91e4a8f9607f5c5c2d94.tar.xz
makefile: add .so file
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 19 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index b550696..2195289 100644
--- a/Makefile
+++ b/Makefile
@@ -1,19 +1,32 @@
# bus - simple message broadcasting IPC system
# See LICENSE file for copyright and license details.
+FLAGS = -std=c99 -Wall -Wextra -pedantic -O2
+
+
all: bus
-bus: bin/bus
+bus: bin/bus bin/libbus.so
-bin/bus: obj/cmdline.o obj/bus.o
+bin/bus: obj/cmdline-nofpic.o obj/bus-nofpic.o
@echo CC -o $@
@mkdir -p bin
- @${CC} -o $@ $^ ${LDFLAGS}
+ @${CC} ${FLAGS} -o $@ $^ ${LDFLAGS}
+
+bin/libbus.so: obj/bus-fpic.o
+ @echo CC -o $@
+ @mkdir -p bin
+ @${CC} ${FLAGS} -shared -o $@ $^ ${LDFLAGS}
+
+obj/%-nofpic.o: src/%.c src/*.h
+ @echo CC -c $@
+ @mkdir -p obj
+ @${CC} ${FLAGS} -c -o $@ ${CPPFLAGS} ${CFLAGS} $<
-obj/%.o: src/%.c src/*.h
- @echo CC -c $<
+obj/%-fpic.o: src/%.c src/*.h
+ @echo CC -c $@
@mkdir -p obj
- @${CC} -Wall -Wextra -pedantic -std=c99 -c -o $@ ${CPPFLAGS} ${CFLAGS} $<
+ @${CC} ${FLAGS} -fPIC -c -o $@ ${CPPFLAGS} ${CFLAGS} $<
clean:
@echo cleaning