Skip to content

Commit bfec89c

Browse files
committed
Merge pull request #470 from WalterBright/build-so-obj
build shared object file
2 parents e895276 + 412c00d commit bfec89c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

posix.mak

+12-2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ OBJDIR=obj/$(MODEL)
6767
DRUNTIME_BASE=druntime-$(OS)$(MODEL)
6868
DRUNTIME=lib/lib$(DRUNTIME_BASE).a
6969
DRUNTIMESO=lib/lib$(DRUNTIME_BASE).so
70+
DRUNTIMESOOBJ=lib/lib$(DRUNTIME_BASE)so.o
71+
DRUNTIMESOLIB=lib/lib$(DRUNTIME_BASE)so.a
7072

7173
DOCFMT=-version=CoreDdoc
7274

@@ -94,7 +96,11 @@ OBJS= $(OBJDIR)/errno_c.o $(OBJDIR)/threadasm.o
9496

9597
######################## All of'em ##############################
9698

99+
ifeq (linux,$(OS))
100+
target : import copy dll $(DRUNTIME) doc
101+
else
97102
target : import copy $(DRUNTIME) doc
103+
endif
98104

99105
######################## Doc .html file generation ##############################
100106

@@ -149,10 +155,14 @@ $(OBJDIR)/threadasm.o : src/core/threadasm.S
149155
######################## Create a shared library ##############################
150156

151157
dll: override PIC:=-fPIC
152-
dll: $(DRUNTIMESO)
158+
dll: $(DRUNTIMESOLIB)
153159

154160
$(DRUNTIMESO): $(OBJS) $(SRCS)
155-
$(DMD) -shared -debuglib= -defaultlib= -of$(DRUNTIMESO) -Xfdruntime.json $(DFLAGS) $(SRCS) $(OBJS)
161+
$(DMD) -shared -debuglib= -defaultlib= -of$(DRUNTIMESO) $(DFLAGS) $(SRCS) $(OBJS)
162+
163+
$(DRUNTIMESOLIB): $(OBJS) $(SRCS)
164+
$(DMD) -c -fPIC -of$(DRUNTIMESOOBJ) $(DFLAGS) $(SRCS)
165+
$(DMD) -lib -of$(DRUNTIMESOLIB) $(DRUNTIMESOOBJ) $(OBJS)
156166

157167
################### Library generation #########################
158168

0 commit comments

Comments
 (0)