Skip to content

Commit

Permalink
build phobos as .so
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Apr 4, 2013
1 parent 113526f commit 96e36c6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ MAKEFILE:=$(lastword $(MAKEFILE_LIST))
# Set DRUNTIME name and full path
ifeq (,$(findstring win,$(OS)))
DRUNTIME = $(DRUNTIME_PATH)/lib/libdruntime-$(OS)$(MODEL).a
DRUNTIMESO = $(DRUNTIME_PATH)/lib/libdruntime-$(OS)$(MODEL)so.a
else
DRUNTIME = $(DRUNTIME_PATH)/lib/druntime.lib
endif
Expand Down Expand Up @@ -151,6 +152,7 @@ DDOC=$(DMD)
# Set LIB, the ultimate target
ifeq (,$(findstring win,$(OS)))
LIB = $(ROOT)/libphobos2.a
LIBSO = $(ROOT)/libphobos2so.so
else
LIB = $(ROOT)/phobos.lib
endif
Expand Down Expand Up @@ -229,8 +231,14 @@ ifeq ($(BUILD),)
# targets. BUILD is not defined in user runs, only by recursive
# self-invocations. So the targets in this branch are accessible to
# end users.
ifeq (linux,$(OS))
release :
$(MAKE) --no-print-directory -f $(MAKEFILE) OS=$(OS) MODEL=$(MODEL) BUILD=release PIC=1 dll
$(MAKE) --no-print-directory -f $(MAKEFILE) OS=$(OS) MODEL=$(MODEL) BUILD=release
else
release :
$(MAKE) --no-print-directory -f $(MAKEFILE) OS=$(OS) MODEL=$(MODEL) BUILD=release
endif
debug :
$(MAKE) --no-print-directory -f $(MAKEFILE) OS=$(OS) MODEL=$(MODEL) BUILD=debug
unittest :
Expand All @@ -253,6 +261,11 @@ $(ROOT)/%$(DOTOBJ) : %.c
$(LIB) : $(OBJS) $(ALL_D_FILES) $(DRUNTIME)
$(DMD) $(DFLAGS) -lib -of$@ $(DRUNTIME) $(D_FILES) $(OBJS)

dll : $(LIBSO)

$(LIBSO): $(OBJS)
$(DMD) $(DFLAGS) -shared -debuglib= -defaultlib= -of$@ $(DRUNTIMESO) $(D_FILES) $(OBJS)

ifeq (osx,$(OS))
# Build fat library that combines the 32 bit and the 64 bit libraries
libphobos2.a : generated/osx/release/32/libphobos2.a generated/osx/release/64/libphobos2.a
Expand Down

0 comments on commit 96e36c6

Please sign in to comment.