build phobos as .so

This commit is contained in:
Walter Bright 2013-04-04 01:05:56 -07:00
parent 113526f6b5
commit 96e36c665e

View file

@ -80,6 +80,7 @@ MAKEFILE:=$(lastword $(MAKEFILE_LIST))
# Set DRUNTIME name and full path # Set DRUNTIME name and full path
ifeq (,$(findstring win,$(OS))) ifeq (,$(findstring win,$(OS)))
DRUNTIME = $(DRUNTIME_PATH)/lib/libdruntime-$(OS)$(MODEL).a DRUNTIME = $(DRUNTIME_PATH)/lib/libdruntime-$(OS)$(MODEL).a
DRUNTIMESO = $(DRUNTIME_PATH)/lib/libdruntime-$(OS)$(MODEL)so.a
else else
DRUNTIME = $(DRUNTIME_PATH)/lib/druntime.lib DRUNTIME = $(DRUNTIME_PATH)/lib/druntime.lib
endif endif
@ -151,6 +152,7 @@ DDOC=$(DMD)
# Set LIB, the ultimate target # Set LIB, the ultimate target
ifeq (,$(findstring win,$(OS))) ifeq (,$(findstring win,$(OS)))
LIB = $(ROOT)/libphobos2.a LIB = $(ROOT)/libphobos2.a
LIBSO = $(ROOT)/libphobos2so.so
else else
LIB = $(ROOT)/phobos.lib LIB = $(ROOT)/phobos.lib
endif endif
@ -229,8 +231,14 @@ ifeq ($(BUILD),)
# targets. BUILD is not defined in user runs, only by recursive # targets. BUILD is not defined in user runs, only by recursive
# self-invocations. So the targets in this branch are accessible to # self-invocations. So the targets in this branch are accessible to
# end users. # 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 : release :
$(MAKE) --no-print-directory -f $(MAKEFILE) OS=$(OS) MODEL=$(MODEL) BUILD=release $(MAKE) --no-print-directory -f $(MAKEFILE) OS=$(OS) MODEL=$(MODEL) BUILD=release
endif
debug : debug :
$(MAKE) --no-print-directory -f $(MAKEFILE) OS=$(OS) MODEL=$(MODEL) BUILD=debug $(MAKE) --no-print-directory -f $(MAKEFILE) OS=$(OS) MODEL=$(MODEL) BUILD=debug
unittest : unittest :
@ -253,6 +261,11 @@ $(ROOT)/%$(DOTOBJ) : %.c
$(LIB) : $(OBJS) $(ALL_D_FILES) $(DRUNTIME) $(LIB) : $(OBJS) $(ALL_D_FILES) $(DRUNTIME)
$(DMD) $(DFLAGS) -lib -of$@ $(DRUNTIME) $(D_FILES) $(OBJS) $(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)) ifeq (osx,$(OS))
# Build fat library that combines the 32 bit and the 64 bit libraries # 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 libphobos2.a : generated/osx/release/32/libphobos2.a generated/osx/release/64/libphobos2.a