Changeset 1727
- Timestamp:
- 07/04/10 22:21:55 (14 years ago)
- Files:
-
- trunk/phobos/linux.mak (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/phobos/linux.mak
r1616 r1727 78 78 ifeq ($(OS),posix) 79 79 CFLAGS += -m32 80 80 ifeq ($(BUILD),debug) 81 81 CFLAGS += -g 82 82 else 83 83 CFLAGS += -O3 84 84 endif 85 85 endif 86 86 87 87 # Set DFLAGS 88 DFLAGS := -I$(DRUNTIME_PATH)/import 88 DFLAGS := -I$(DRUNTIME_PATH)/import $(DMDEXTRAFLAGS) 89 89 ifeq ($(BUILD),debug) 90 90 DFLAGS += -w -g -debug -d 91 91 else 92 92 DFLAGS += -w -O -release -nofloat -d 93 93 endif 94 94 95 95 # Set DOTOBJ and DOTEXE 96 96 ifeq (,$(findstring win,$(OS))) 97 97 DOTOBJ:=.o 98 98 DOTEXE:= … … 112 112 ifeq (,$(findstring win,$(OS))) 113 113 LIB = $(ROOT)/libphobos2.a 114 114 else 115 115 LIB = $(ROOT)/phobos.lib 116 116 endif 117 117 118 118 ################################################################################ 119 119 MAIN = $(ROOT)/emptymain.d 120 120 121 121 # Stuff in std/ 122 STD_MODULES = $(addprefix std/, algorithm a ll array base64 bigint\123 b itmanip boxer compiler complex concurrency container\124 c ontracts conv cpuid cstream ctype date datebase dateparse\125 demangle encoding file format functional getopt gregorian\126 intrinsic json loader math md5 metastrings mmfile numeric\127 outbuffer path perf process random range regex regexp signals\128 socket socketstream stdint stdio stdiobase stream string\129 sys error system traits typecons typetuple uni uri utf variant\130 xml zipzlib)122 STD_MODULES = $(addprefix std/, algorithm array base64 bigint bitmanip \ 123 boxer compiler complex concurrency container contracts conv \ 124 cpuid cstream ctype date datebase dateparse demangle encoding \ 125 exception file format functional getopt gregorian intrinsic \ 126 json loader math md5 metastrings mmfile numeric outbuffer path \ 127 perf process random range regex regexp signals socket \ 128 socketstream stdint stdio stdiobase stream string syserror \ 129 system traits typecons typetuple uni uri utf variant xml zip \ 130 zlib) 131 131 132 132 # Other D modules that aren't under std/ 133 133 EXTRA_MODULES := $(addprefix std/c/, stdarg stdio) $(addprefix etc/c/, \ 134 134 zlib) $(addprefix std/internal/math/, biguintcore biguintnoasm \ 135 135 biguintx86) 136 136 137 137 # OS-specific D modules 138 138 EXTRA_MODULES_POSIX := $(addprefix std/c/linux/, linux socket) 139 139 EXTRA_MODULES_WIN32 := $(addprefix std/c/windows/, com stat windows \ 140 140 winsock) $(addprefix std/windows/, charset iunknown syserror) … … 185 185 else 186 186 # This branch is normally taken in recursive builds. All we need to do 187 187 # is set the default build to $(BUILD) (which is either debug or 188 188 # release) and then let the unittest depend on that build's unittests. 189 189 $(BUILD) : $(LIB) 190 190 unittest : $(addsuffix $(DOTEXE),$(addprefix $(ROOT)/unittest/,$(D_MODULES))) 191 191 endif 192 192 193 193 ################################################################################ 194 194 195 std/all.d : $(MAKEFILE)196 @echo module std.all\;\\n \197 $(addprefix public import ,$(addsuffix \;\\n,$(STD_MODULES))) | \198 sed -e 's|/|.|' -e '/public import std\.all/d' >$@199 200 195 $(ROOT)/%$(DOTOBJ) : %.c 201 196 @[ -d $(dir $@) ] || mkdir -p $(dir $@) || [ -d $(dir $@) ] 202 197 $(CC) -c $(CFLAGS) $< -o$@ 203 198 204 199 $(LIB) : $(OBJS) $(ALL_D_FILES) $(DRUNTIME) 205 200 $(DMD) $(DFLAGS) -lib -of$@ $(DRUNTIME) $(D_FILES) $(OBJS) 206 201 207 202 $(ROOT)/unittest/%$(DOTEXE) : %.d $(LIB) $(ROOT)/emptymain.d 208 203 @echo Testing $@ 209 204 @$(DMD) $(DFLAGS) -unittest $(LINKOPTS) -of$@ $(ROOT)/emptymain.d $< … … 218 213 %$(DOTEXE) : %$(DOTOBJ) 219 214 220 215 $(ROOT)/emptymain.d : $(ROOT)/.directory 221 216 @echo 'void main(){}' >$@ 222 217 223 218 $(ROOT)/.directory : 224 219 mkdir -p $(ROOT) || exists $(ROOT) 225 220 touch $@ 226 221 227 222 clean : 228 rm -rf $(ROOT_OF_THEM_ALL) $(ZIPFILE) $(DOC_OUTPUT_DIR) std/all.d223 rm -rf $(ROOT_OF_THEM_ALL) $(ZIPFILE) $(DOC_OUTPUT_DIR) 229 224 230 225 zip : 231 226 zip $(ZIPFILE) $(MAKEFILE) $(ALL_D_FILES) $(ALL_C_FILES) 232 227 233 228 install : release 234 229 sudo cp $(LIB) /usr/lib/ 235 230 236 231 $(DRUNTIME) : 237 232 $(MAKE) -C $(DRUNTIME_PATH) -f posix.mak 238 233 … … 250 245 251 246 $(DOC_OUTPUT_DIR)/std_c_linux_%.html : std/c/linux/%.d $(STDDOC) 252 247 wine dmd $(DDOCFLAGS) -Df$@ $< 253 248 254 249 $(STYLECSS_TGT) : $(STYLECSS_SRC) 255 250 cp $< $@ 256 251 257 252 html : $(addprefix $(DOC_OUTPUT_DIR)/, $(subst /,_,$(subst .d,.html, \ 258 253 $(SRC_DOCUMENTABLES)))) $(STYLECSS_TGT) 259 254 @$(MAKE) -f $(DOCSRC)/linux.mak -C $(DOCSRC) --no-print-directory 255
