Skip to content

Commit

Permalink
Fix issue 2: move chan$O from OBJS to THREADS. Also fix typo in insta…
Browse files Browse the repository at this point in the history
…ll.html and add

a makerule for building a shared library on Linux.
  • Loading branch information
drhanson committed Dec 1, 2008
1 parent e03508c commit 2cfd6e2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion install.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ <h2><a NAME="unix">Installation on UNIX</a></h2>
and the examples. There may be some warnings on some platforms. The assignment <code>THREADS=</code>
appears on those platforms for which there is no Thread implementation. On these
platforms, examples that use Thread won't link correctly, so use the <code>-k</code>
option cause make to keep going.</p>
option so make keeps going.</p>
<p><a name="maxalign">On most platforms</a>, <code>malloc</code> returns pointers to
blocks that are aligned on addresses that are multiples of the size of the largest basic
data type. Some CII functions use a union to determine this multiple (cf. <code>union</code>&nbsp;<code>align</code>
Expand Down
9 changes: 7 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# $Id$
MAJORVERSION=2
A=.a
O=.o
SO=.so
E=
CC=cc
I=include
Expand All @@ -14,7 +16,7 @@ DIFF=diff
RM=rm -f
CUSTOM=custom.mk
EXTRAS=$(BUILDDIR)memcmp$O $(BUILDDIR)memmove$O $(BUILDDIR)strncmp$O
THREADS=$(BUILDDIR)thread$O $(BUILDDIR)swtch$O
THREADS=$(BUILDDIR)thread$O $(BUILDDIR)swtch$O $(BUILDDIR)chan$O
include $(CUSTOM)
B=$(BUILDDIR)

Expand All @@ -25,7 +27,6 @@ OBJS= $Bap$O \
$Bassert$O \
$Batom$O \
$Bbit$O \
$Bchan$O \
$Bexcept$O \
$Bfmt$O \
$Blist$O \
Expand Down Expand Up @@ -63,6 +64,10 @@ all:: $Blibcii$A $(EXAMPLES) $Bmemchk$O
$Blibcii$A:: $(OBJS) $(EXTRAS)
$(AR) $@ $(OBJS) $(EXTRAS); $(RANLIB) $@ || true

# Linux-specific rule for building a shared library
$Blibcii$(SO).$(MAJORVERSION): $(OBJS) $(EXTRAS)
$(CC) -shared -Wl,-soname,libcii$(SO).$(MAJORVERSION) -o $@ $(OBJS) $(EXTRAS)

$Bap$O: src/ap.c; $(CC) $(CFLAGS) -c -o $@ src/ap.c
$Barena$O: src/arena.c; $(CC) $(CFLAGS) -c -o $@ src/arena.c
$Barith$O: src/arith.c; $(CC) $(CFLAGS) -c -o $@ src/arith.c
Expand Down
3 changes: 1 addition & 2 deletions makefile.nt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ B=$(BUILDDIR)^\
CFLAGS=-Zi -MTd -I$I
LD=cl -nologo
LDFLAGS=-Zi -MTd
THREADS=$Bthread-nt$O
THREADS=$Bthread-nt$O $Bchan$O
EXTRAS=

# $Id$
Expand All @@ -20,7 +20,6 @@ OBJS= $Bap$O \
$Bassert$O \
$Batom$O \
$Bbit$O \
$Bchan$O \
$Bexcept$O \
$Bfmt$O \
$Blist$O \
Expand Down

0 comments on commit 2cfd6e2

Please sign in to comment.