Skip to content

Commit

Permalink
the library can be compiled as a shared library
Browse files Browse the repository at this point in the history
The shared library libdtree.so is preferred when compiling busio.
But if only libdtree.a exists, it is used instead.
  • Loading branch information
Jan Viktorin committed Jun 12, 2012
1 parent d390140 commit f875c3a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Makefile
@@ -1,14 +1,18 @@
CC = gcc
AR = ar
CFLAGS = -std=gnu99 -Wall -pedantic -Wextra -g
CFLAGS = -std=gnu99 -Wall -pedantic -Wextra -g -fPIC

Q ?= @

all: libdtree.a
all: libdtree.a libdtree.so
libdtree.a: dtree_error.o dtree_procfs.o dtree.o bcd_arith.o
$(Q) $(AR) rcs $@ $^

busio: busio.o libdtree.a
libdtree.so: dtree_error.o dtree_procfs.o dtree.o bcd_arith.o
$(Q) $(CC) -shared -o $@ $^

busio: busio.o
$(CC) $(LDFLAGS) $^ -L. -ldtree -o $@
busio.o: busio.c

clean:
Expand Down

0 comments on commit f875c3a

Please sign in to comment.