Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add fat library target for OSX

  • Loading branch information...
commit 3e0415cf047ae1f165c81121ffe27c4e5ead12ed 1 parent e696518
@WalterBright WalterBright authored
Showing with 102 additions and 102 deletions.
  1. +102 −102 posix.mak
View
204 posix.mak
@@ -41,7 +41,7 @@ endif
# For now, 32 bit is the default model
ifeq (,$(MODEL))
- MODEL:=32
+ MODEL:=32
endif
# Configurable stuff that's rarely edited
@@ -75,58 +75,58 @@ MAKEFILE:=$(lastword $(MAKEFILE_LIST))
# Set DRUNTIME name and full path
ifeq (,$(findstring win,$(OS)))
- DRUNTIME = $(DRUNTIME_PATH)/lib/libdruntime.a
+ DRUNTIME = $(DRUNTIME_PATH)/lib/libdruntime.a
else
- DRUNTIME = $(DRUNTIME_PATH)/lib/druntime.lib
+ DRUNTIME = $(DRUNTIME_PATH)/lib/druntime.lib
endif
# Set CC and DMD
ifeq ($(OS),win32wine)
- CC = wine dmc.exe
- DMD = wine dmd.exe
- RUN = wine
+ CC = wine dmc.exe
+ DMD = wine dmd.exe
+ RUN = wine
else
- ifeq ($(OS),win32remote)
- DMD = ssh 206.125.170.138 "cd code/dmd/phobos && dmd"
- CC = ssh 206.125.170.138 "cd code/dmd/phobos && dmc"
- else
- DMD = dmd
- ifeq ($(OS),win32)
- CC = dmc
- else
- CC = cc
- endif
- endif
- RUN =
+ ifeq ($(OS),win32remote)
+ DMD = ssh 206.125.170.138 "cd code/dmd/phobos && dmd"
+ CC = ssh 206.125.170.138 "cd code/dmd/phobos && dmc"
+ else
+ DMD = dmd
+ ifeq ($(OS),win32)
+ CC = dmc
+ else
+ CC = cc
+ endif
+ endif
+ RUN =
endif
# Set CFLAGS
ifeq ($(CC),cc)
- CFLAGS += -m$(MODEL)
- ifeq ($(BUILD),debug)
- CFLAGS += -g
- else
- CFLAGS += -O3
- endif
+ CFLAGS += -m$(MODEL)
+ ifeq ($(BUILD),debug)
+ CFLAGS += -g
+ else
+ CFLAGS += -O3
+ endif
endif
# Set DFLAGS
DFLAGS := -I$(DRUNTIME_PATH)/import $(DMDEXTRAFLAGS) -w -d -m$(MODEL)
ifeq ($(BUILD),debug)
- DFLAGS += -g -debug
+ DFLAGS += -g -debug
else
- DFLAGS += -O -release -nofloat
+ DFLAGS += -O -release -nofloat
endif
# Set DOTOBJ and DOTEXE
ifeq (,$(findstring win,$(OS)))
- DOTOBJ:=.o
- DOTEXE:=
- PATHSEP:=/
+ DOTOBJ:=.o
+ DOTEXE:=
+ PATHSEP:=/
else
- DOTOBJ:=.obj
- DOTEXE:=.exe
- PATHSEP:=$(shell echo "\\")
+ DOTOBJ:=.obj
+ DOTEXE:=.exe
+ PATHSEP:=$(shell echo "\\")
endif
# Set LINKOPTS
@@ -145,23 +145,23 @@ DDOC=dmd
# Set LIB, the ultimate target
ifeq (,$(findstring win,$(OS)))
- LIB = $(ROOT)/libphobos2.a
+ LIB = $(ROOT)/libphobos2.a
else
- LIB = $(ROOT)/phobos.lib
+ LIB = $(ROOT)/phobos.lib
endif
################################################################################
MAIN = $(ROOT)/emptymain.d
# Stuff in std/
-STD_MODULES = $(addprefix std/, algorithm array ascii base64 bigint \
- bitmanip compiler complex concurrency container contracts conv \
- cpuid cstream ctype date datetime datebase dateparse demangle \
- encoding exception file format functional getopt gregorian \
- json loader math mathspecial md5 metastrings mmfile numeric \
- outbuffer parallelism path perf process random range regex \
- regexp signals socket socketstream stdint stdio stdiobase \
- stream string syserror system traits typecons typetuple uni \
+STD_MODULES = $(addprefix std/, algorithm array ascii base64 bigint \
+ bitmanip compiler complex concurrency container contracts conv \
+ cpuid cstream ctype date datetime datebase dateparse demangle \
+ encoding exception file format functional getopt gregorian \
+ json loader math mathspecial md5 metastrings mmfile numeric \
+ outbuffer parallelism path perf process random range regex \
+ regexp signals socket socketstream stdint stdio stdiobase \
+ stream string syserror system traits typecons typetuple uni \
uri utf variant xml zip zlib)
STD_NET_MODULES = $(addprefix std/net/, isemail)
@@ -170,42 +170,42 @@ STD_NET_MODULES = $(addprefix std/net/, isemail)
EXTRA_MODULES_LINUX := $(addprefix std/c/linux/, linux socket)
EXTRA_MODULES_OSX := $(addprefix std/c/osx/, socket)
EXTRA_MODULES_FREEBSD := $(addprefix std/c/freebsd/, socket)
-EXTRA_MODULES_WIN32 := $(addprefix std/c/windows/, com stat windows \
- winsock) $(addprefix std/windows/, charset iunknown syserror)
+EXTRA_MODULES_WIN32 := $(addprefix std/c/windows/, com stat windows \
+ winsock) $(addprefix std/windows/, charset iunknown syserror)
ifeq (,$(findstring win,$(OS)))
- EXTRA_DOCUMENTABLES:=$(EXTRA_MODULES_LINUX)
+ EXTRA_DOCUMENTABLES:=$(EXTRA_MODULES_LINUX)
else
- EXTRA_DOCUMENTABLES:=$(EXTRA_MODULES_WIN32)
+ EXTRA_DOCUMENTABLES:=$(EXTRA_MODULES_WIN32)
endif
# Other D modules that aren't under std/
-EXTRA_DOCUMENTABLES += $(addprefix etc/c/,curl zlib) $(addprefix \
-std/c/, fenv locale math process stdarg stddef stdio stdlib string \
+EXTRA_DOCUMENTABLES += $(addprefix etc/c/,curl zlib) $(addprefix \
+std/c/, fenv locale math process stdarg stddef stdio stdlib string \
time wcharh)
-EXTRA_MODULES += $(EXTRA_DOCUMENTABLES) $(addprefix \
- std/internal/math/, biguintcore biguintnoasm biguintx86 \
- gammafunction errorfunction) $(addprefix std/internal/, \
- processinit uni uni_tab)
+EXTRA_MODULES += $(EXTRA_DOCUMENTABLES) $(addprefix \
+ std/internal/math/, biguintcore biguintnoasm biguintx86 \
+ gammafunction errorfunction) $(addprefix std/internal/, \
+ processinit uni uni_tab)
# Aggregate all D modules relevant to this build
D_MODULES = crc32 $(STD_MODULES) $(EXTRA_MODULES) $(STD_NET_MODULES)
# Add the .d suffix to the module names
D_FILES = $(addsuffix .d,$(D_MODULES))
# Aggregate all D modules over all OSs (this is for the zip file)
-ALL_D_FILES = $(addsuffix .d,crc32 $(STD_MODULES) $(EXTRA_MODULES) \
+ALL_D_FILES = $(addsuffix .d,crc32 $(STD_MODULES) $(EXTRA_MODULES) \
$(EXTRA_MODULES_LINUX) $(EXTRA_MODULES_OSX) $(EXTRA_MODULES_FREEBSD) $(EXTRA_MODULES_WIN32)) \
- std/stdarg.d std/bind.d std/internal/windows/advapi32.d std/__fileinit.d \
- std/windows/registry.d std/c/linux/pthread.d std/c/linux/termios.d \
- std/c/linux/tipc.d std/net/isemail.d
+ std/stdarg.d std/bind.d std/internal/windows/advapi32.d std/__fileinit.d \
+ std/windows/registry.d std/c/linux/pthread.d std/c/linux/termios.d \
+ std/c/linux/tipc.d std/net/isemail.d
# C files to be part of the build
-C_MODULES = $(addprefix etc/c/zlib/, adler32 compress crc32 deflate \
- gzclose gzlib gzread gzwrite infback inffast inflate inftrees trees uncompr zutil)
+C_MODULES = $(addprefix etc/c/zlib/, adler32 compress crc32 deflate \
+ gzclose gzlib gzread gzwrite infback inffast inflate inftrees trees uncompr zutil)
C_FILES = $(addsuffix .c,$(C_MODULES))
# C files that are not compiled (right now only zlib-related)
-C_EXTRAS = $(addprefix etc/c/zlib/, algorithm.txt ChangeLog crc32.h \
-deflate.h example.c inffast.h inffixed.h inflate.h inftrees.h \
-linux.mak minigzip.c osx.mak README trees.h win32.mak zconf.h \
+C_EXTRAS = $(addprefix etc/c/zlib/, algorithm.txt ChangeLog crc32.h \
+deflate.h example.c inffast.h inffixed.h inflate.h inftrees.h \
+linux.mak minigzip.c osx.mak README trees.h win32.mak zconf.h \
gzguts.h zlib.3 zlib.h zutil.h)
# Aggregate all C files over all OSs (this is for the zip file)
ALL_C_FILES = $(C_FILES) $(C_EXTRAS)
@@ -222,12 +222,12 @@ ifeq ($(BUILD),)
# self-invocations. So the targets in this branch are accessible to
# end users.
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
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 :
- $(MAKE) --no-print-directory -f $(MAKEFILE) OS=$(OS) MODEL=$(MODEL) BUILD=debug unittest
- $(MAKE) --no-print-directory -f $(MAKEFILE) OS=$(OS) MODEL=$(MODEL) BUILD=release unittest
+ $(MAKE) --no-print-directory -f $(MAKEFILE) OS=$(OS) MODEL=$(MODEL) BUILD=debug unittest
+ $(MAKE) --no-print-directory -f $(MAKEFILE) OS=$(OS) MODEL=$(MODEL) BUILD=release unittest
else
# This branch is normally taken in recursive builds. All we need to do
# is set the default build to $(BUILD) (which is either debug or
@@ -239,16 +239,16 @@ endif
################################################################################
$(ROOT)/%$(DOTOBJ) : %.c
- @[ -d $(dir $@) ] || mkdir -p $(dir $@) || [ -d $(dir $@) ]
- $(CC) -c $(CFLAGS) $< -o$@
+ @[ -d $(dir $@) ] || mkdir -p $(dir $@) || [ -d $(dir $@) ]
+ $(CC) -c $(CFLAGS) $< -o$@
$(LIB) : $(OBJS) $(ALL_D_FILES) $(DRUNTIME)
- $(DMD) $(DFLAGS) -lib -of$@ $(DRUNTIME) $(D_FILES) $(OBJS)
+ $(DMD) $(DFLAGS) -lib -of$@ $(DRUNTIME) $(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
- lipo generated/osx/release/32/libphobos2.a generated/osx/release/64/libphobos2.a -create -output generated/osx/release/libphobos2.a
+ lipo generated/osx/release/32/libphobos2.a generated/osx/release/64/libphobos2.a -create -output generated/osx/release/libphobos2.a
endif
ifeq ($(MODEL),64)
@@ -259,84 +259,84 @@ DISABLED_TESTS += std/math
# seems to infinite loop, need to reduce
$(addprefix $(ROOT)/unittest/,$(DISABLED_TESTS)) :
- @echo Testing $@ - disabled
+ @echo Testing $@ - disabled
endif
$(ROOT)/unittest/%$(DOTEXE) : %.d $(LIB) $(ROOT)/emptymain.d
- @echo Testing $@
- @$(DMD) $(DFLAGS) -unittest $(LINKOPTS) $(subst /,$(PATHSEP),"-of$@") \
- $(ROOT)/emptymain.d $<
+ @echo Testing $@
+ @$(DMD) $(DFLAGS) -unittest $(LINKOPTS) $(subst /,$(PATHSEP),"-of$@") \
+ $(ROOT)/emptymain.d $<
# make the file very old so it builds and runs again if it fails
- @touch -t 197001230123 $@
+ @touch -t 197001230123 $@
# run unittest in its own directory
- @$(RUN) $@
+ @$(RUN) $@
# succeeded, render the file new again
- @touch $@
+ @touch $@
# Disable implicit rule
%$(DOTEXE) : %$(DOTOBJ)
$(ROOT)/emptymain.d : $(ROOT)/.directory
- @echo 'void main(){}' >$@
+ @echo 'void main(){}' >$@
$(ROOT)/.directory :
- mkdir -p $(ROOT) || exists $(ROOT)
- touch $@
+ mkdir -p $(ROOT) || exists $(ROOT)
+ touch $@
clean :
- rm -rf $(ROOT_OF_THEM_ALL) $(ZIPFILE) $(DOC_OUTPUT_DIR)
+ rm -rf $(ROOT_OF_THEM_ALL) $(ZIPFILE) $(DOC_OUTPUT_DIR)
zip :
- zip $(ZIPFILE) $(MAKEFILE) $(ALL_D_FILES) $(ALL_C_FILES)
+ zip $(ZIPFILE) $(MAKEFILE) $(ALL_D_FILES) $(ALL_C_FILES)
install : release
- sudo cp $(LIB) /usr/lib/
+ sudo cp $(LIB) /usr/lib/
$(DRUNTIME) :
- $(MAKE) -C $(DRUNTIME_PATH) -f posix.mak MODEL=$(MODEL)
+ $(MAKE) -C $(DRUNTIME_PATH) -f posix.mak MODEL=$(MODEL)
###########################################################
# html documentation
-HTMLS=$(addprefix $(DOC_OUTPUT_DIR)/, $(subst /,_,$(subst .d,.html, \
- $(SRC_DOCUMENTABLES))))
-BIGHTMLS=$(addprefix $(BIGDOC_OUTPUT_DIR)/, $(subst /,_,$(subst \
- .d,.html, $(SRC_DOCUMENTABLES))))
+HTMLS=$(addprefix $(DOC_OUTPUT_DIR)/, $(subst /,_,$(subst .d,.html, \
+ $(SRC_DOCUMENTABLES))))
+BIGHTMLS=$(addprefix $(BIGDOC_OUTPUT_DIR)/, $(subst /,_,$(subst \
+ .d,.html, $(SRC_DOCUMENTABLES))))
$(DOC_OUTPUT_DIR)/. :
- mkdir -p $@
+ mkdir -p $@
$(DOC_OUTPUT_DIR)/std_%.html : std/%.d $(STDDOC)
- $(DDOC) $(DDOCFLAGS) $(STDDOC) -Df$@ $<
+ $(DDOC) $(DDOCFLAGS) $(STDDOC) -Df$@ $<
$(DOC_OUTPUT_DIR)/std_c_%.html : std/c/%.d $(STDDOC)
- $(DDOC) $(DDOCFLAGS) $(STDDOC) -Df$@ $<
+ $(DDOC) $(DDOCFLAGS) $(STDDOC) -Df$@ $<
$(DOC_OUTPUT_DIR)/std_c_linux_%.html : std/c/linux/%.d $(STDDOC)
- $(DDOC) $(DDOCFLAGS) $(STDDOC) -Df$@ $<
+ $(DDOC) $(DDOCFLAGS) $(STDDOC) -Df$@ $<
$(DOC_OUTPUT_DIR)/std_c_windows_%.html : std/c/windows/%.d $(STDDOC)
- $(DDOC) $(DDOCFLAGS) -Df$@ $<
+ $(DDOC) $(DDOCFLAGS) -Df$@ $<
$(DOC_OUTPUT_DIR)/std_net_%.html : std/net/%.d $(STDDOC)
- $(DDOC) $(DDOCFLAGS) $(STDDOC) -Df$@ $<
+ $(DDOC) $(DDOCFLAGS) $(STDDOC) -Df$@ $<
$(DOC_OUTPUT_DIR)/etc_c_%.html : etc/c/%.d $(STDDOC)
- $(DDOC) $(DDOCFLAGS) $(STDDOC) -Df$@ $<
+ $(DDOC) $(DDOCFLAGS) $(STDDOC) -Df$@ $<
$(DOC_OUTPUT_DIR)/%.html : %.d $(STDDOC)
- $(DDOC) $(DDOCFLAGS) $(STDDOC) -Df$@ $<
+ $(DDOC) $(DDOCFLAGS) $(STDDOC) -Df$@ $<
html : $(DOC_OUTPUT_DIR)/. $(HTMLS) $(STYLECSS_TGT)
rsync-prerelease : html
- rsync -avz $(DOC_OUTPUT_DIR)/ d-programming@digitalmars.com:data/phobos-prerelease/
- rsync -avz $(WEBSITE_DIR)/ d-programming@digitalmars.com:data/phobos-prerelase/
+ rsync -avz $(DOC_OUTPUT_DIR)/ d-programming@digitalmars.com:data/phobos-prerelease/
+ rsync -avz $(WEBSITE_DIR)/ d-programming@digitalmars.com:data/phobos-prerelase/
html_consolidated :
- $(DDOC) $(DDOCFLAGS) -Df$(DOCSRC)/std_consolidated_header.html $(DOCSRC)/std_consolidated_header.dd
- $(DDOC) $(DDOCFLAGS) -Df$(DOCSRC)/std_consolidated_footer.html $(DOCSRC)/std_consolidated_footer.dd
- $(MAKE) DOC_OUTPUT_DIR=$(BIGDOC_OUTPUT_DIR) STDDOC=$(BIGSTDDOC) html -j 8
- cat $(DOCSRC)/std_consolidated_header.html $(BIGHTMLS) \
- $(DOCSRC)/std_consolidated_footer.html > $(DOC_OUTPUT_DIR)/std_consolidated.html
+ $(DDOC) $(DDOCFLAGS) -Df$(DOCSRC)/std_consolidated_header.html $(DOCSRC)/std_consolidated_header.dd
+ $(DDOC) $(DDOCFLAGS) -Df$(DOCSRC)/std_consolidated_footer.html $(DOCSRC)/std_consolidated_footer.dd
+ $(MAKE) DOC_OUTPUT_DIR=$(BIGDOC_OUTPUT_DIR) STDDOC=$(BIGSTDDOC) html -j 8
+ cat $(DOCSRC)/std_consolidated_header.html $(BIGHTMLS) \
+ $(DOCSRC)/std_consolidated_footer.html > $(DOC_OUTPUT_DIR)/std_consolidated.html
Please sign in to comment.
Something went wrong with that request. Please try again.