Changeset 123 for trunk/src/emx/Makefile
- Timestamp:
- May 12, 2003, 12:48:43 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/Makefile
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r122 r123 23 23 OUT = out/ 24 24 # Base installation directory 25 INS = out/ install/25 INS = out/$(MODE)/install/ 26 26 # CPU type (pretend we are portable ;-) 27 27 CPU = 386 28 # The object file format to use for tools (emxomf, ld and friends) 29 TOOLFMT.dbg = aout 30 TOOLFMT.opt = omf 31 TOOLFMT = $(TOOLFMT.$(MODE)) 28 32 29 33 # Use ash.exe which is quite fast (comparable to cmd.exe) but has more features … … 44 48 CC = gcc -c 45 49 # The C compiler flags 46 CFLAGS = -Wall -Iinclude -Isrc/include $(CFLAGS.$(MODE)) $(CFLAGS.KIND) 50 CFLAGS.INC = -Iinclude -Isrc/include 51 CFLAGS = -Wall -mstack-arg-probe -Zmt $(CFLAGS.INC) $(CFLAGS.$(MODE)) $(CFLAGS.KIND) 47 52 # The additional C compiler flags for different build modes 48 53 CFLAGS.opt = -s -O3 -fomit-frame-pointer … … 50 55 CFLAGS.aout = 51 56 CFLAGS.omf = -Zomf 52 CFLAGS.st =53 CFLAGS.mt = -Zmt54 57 CFLAGS.prof = -pg 55 58 # The object files are put in subdirectory objectformat-targetkind, … … 63 66 LD = gcc 64 67 # Linker flags 65 LDFLAGS = $(LDFLAGS.$(MODE)) $(LDFLAGS.KIND)68 LDFLAGS = -Zmt $(LDFLAGS.$(MODE)) $(LDFLAGS.KIND) 66 69 # Linker flags for different build modes 67 70 LDFLAGS.opt = -s … … 69 72 LDFLAGS.aout = 70 73 LDFLAGS.omf = -Zomf -Zsys -Zsmall-conv -Zlinker /PM:VIO 71 LDFLAGS.st = 72 LDFLAGS.mt = -Zmt 73 LDFLAGS.stp = -pg 74 LDFLAGS.mtp = -pg -Zmt 74 LDFLAGS.prof = -pg 75 75 # Linker flags for different kinds of target 76 76 LDFLAGS.KIND = $(foreach x,$(subst -, ,$(firstword $(subst /, ,$(subst $.,,$@)))),$(LDFLAGS.$x)) … … 88 88 ARFLAGS = crs 89 89 DO.LIBRARY = $(AR) $(ARFLAGS) $@ $(^O) 90 91 # How to create dependencies 92 MAKEDEP = makedep 93 MAKEDEPFLAGS = $(CFLAGS.INC) 94 DO.DEPS = $(MAKEDEP) $(MAKEDEPFLAGS) \ 95 -I$(subst $(SPACE), -I,$(sort $(dir $^))) -p$(@D)/ -c -S -f$@ $^ 96 97 # How to convert an a.out file to the OMF format 98 DO.AOUT2OMF = emxomf $(strip $1 -o) $@ $< 90 99 91 100 # How to filter just the object files from $^ … … 109 118 SEP := ========================================================================== 110 119 111 # How to remove a file120 # How to remove one or more files without questions 112 121 RM = rm -f $1 122 # How to remove one or more directories without questions 123 RMDIR = rm -rf $1 124 # How to copy several files to a directory 125 CP = cp $1 $2 113 126 # Miscelaneous tools 114 127 MKDIR = mkdir.exe -p $1 … … 117 130 ECHOIZE = $(subst $$,\$$,$1$(strip $(subst $(SPACE)$(COMMA),$(COMMA),$(foreach x,2 3 4 5 6 7 8 9,$(if $($x),$(COMMA) $($x)))))) 118 131 # How to output a text string (with appended newline) 119 # bird: skip the .exe and ash will use internal echo implementation which is way faster120 #ECHO = echo.exe "$(call ECHOIZE,$1,$2,$3,$4,$5,$6,$7,$8,$9)"121 132 ECHO = echo "$(call ECHOIZE,$1,$2,$3,$4,$5,$6,$7,$8,$9)" 122 133 # Same but append the text to a file (given with first argument) 123 # bird: skip the .exe and ash will use internal echo implementation which is way faster124 #FECHO = echo.exe "$(call ECHOIZE,$2,$3,$4,$5,$6,$7,$8,$9)" >> "$1"125 134 FECHO = echo "$(call ECHOIZE,$2,$3,$4,$5,$6,$7,$8,$9)" >> "$1" 126 135 # How to replace the source file extension with a .o extension … … 145 154 # Build rules (_@_ replaced by name of generated makefile) 146 155 RULES := 147 148 .PHONY: default help all clean install 156 # The list of dependency files 157 TARGDEPEND := 158 159 .PHONY: default help all clean install cleandep cleandepend dep depend depdone 149 160 .SUFFIXES: 150 .SUFFIXES: .c .cpp .asm .s .o .exe .dll .a .lib 161 .SUFFIXES: .c .cpp .asm .s .o .exe .dll .a .lib .obj 151 162 152 163 # Default target … … 172 183 @$(call ECHO, clean - remove all generated files (remove all built files)) 173 184 @$(call ECHO, install - generate a installation tree in $(INS)) 185 @$(call ECHO, dep - generate dependency files for all changed targets) 186 @$(call ECHO, cleandep - remove all dependency file) 174 187 @$(call ECHO,$(SEP)) 175 188 @$(call ECHO,There are a number of variables than can be set in the make) … … 181 194 @$(call ECHO,$(SEP)) 182 195 183 all: $( MODULES)196 all: $(TARGDIRS) $(MODULES) 184 197 185 198 clean: 186 rm -rf $(OUT) 187 188 install: $(INSDIRS) 199 $(call RMDIR,$(OUT)) 200 201 cleandep cleandepend: 202 $(call RM,$(TARGDEPEND)) 203 204 dep depend: 205 @$(MAKE) --no-print-directory BUILD_DEPS=1 depdone 206 207 depdone: 208 @$(call ECHO,Dependency files succesfully updated) 209 210 install: all $(INSDIRS) 189 211 $(DO.INSTALL) 190 212 191 $ (OUT) $. $(INSDIRS) $(TARGDIRS):213 $. $(INSDIRS) $(TARGDIRS): 192 214 $(call MKDIR,$@) 193 215 194 # bird: add rule for generating the rules. 195 rules: rules-rm $(OUT)genrules.smak 196 rules-rm: 197 @$(call RM,$(OUT)genrules.smak) 198 199 #$(OUT)genrules.smak: $(OUT) Makefile $(SUBMAK) 200 # bird: depeding on $(OUT) make it unstable. 201 $(OUT)genrules.smak: Makefile $(SUBMAK) 202 $(call MKDIR,$(@D)) 203 @$(call ECHO,Please wait, rebuilding make rules $@ ...) 216 $(OUT)genrules.smak: $(SUBMAK) # Makefile $(wildcard *.smak) 217 @$(call MKDIR,$(OUT)) 218 @$(call ECHO,Please wait, rebuilding make rules ...) 204 219 @$(call RM,$@) 205 220 @$(call FECHO,$@,# Autogenerated file -- DO NOT EDIT!) 206 221 @$(subst _@,$@,$(RULES)) 207 222 223 # The general a.out -> OMF conversion rule for object files 224 $.omf/%.obj: $.aout/%.o 225 $(call DO.AOUT2OMF) 226 227 # The general a.out -> OMF conversion rule for libraries 228 $.omf%.lib: $.aout%.a 229 $(call DO.AOUT2OMF) 230 208 231 -include $(OUT)genrules.smak 209 -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.