Chameleon

Chameleon Commit Details

Date:2011-08-04 17:14:30 (8 years 17 days ago)
Author:Evan Lojewski
Commit:1272
Parents: 1271
Message:Makefile updates
Changes:
M/branches/xZenu/src/modules/MakeInc.dir
M/branches/xZenu/src/Makefile
M/branches/xZenu/src/modules/uClibcxx/include/char_traits
M/branches/xZenu/src/arch/ppc/Make.rules
M/branches/xZenu/src/arch/i386/boot2/Makefile

File differences

branches/xZenu/src/modules/uClibcxx/include/char_traits
2121
2222
2323
24
25
26
27
2824
2925
3026
......
110106
111107
112108
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195109
196110
197111
#include <exception>
#include <memory>
#ifdef __UCLIBCXX_HAS_WCHAR__
#include <cwchar>
#include <cwctype>
#endif
#ifndef __HEADER_CHAR_TRAITS
#define __HEADER_CHAR_TRAITS 1
return a;
}
};
#ifdef __UCLIBCXX_HAS_WCHAR__
template<> struct _UCXXEXPORT char_traits<wchar_t> {
typedef wchar_t char_type;
typedef wint_t int_type;
typedef char_traits_off_type off_type;
typedef char_traits_off_type pos_type;
typedef mbstate_t state_type;
static void assign(char_type & c, const char_type & d){ c=d; }
static char_type to_char_type(const int_type & i){
return i;
}
static int_type to_int_type(const char_type & c){
return c;
}
inline static bool eq_int_type(const int_type & a, const int_type & b){
if(a==b){
return true;
}
return false;
}
inline static bool eq(const char_type& c1, const char_type& c2){
if(wcsncmp(&c1, &c2, 1) == 0){
return true;
}
return false;
}
inline static bool lt(const char_type& c1, const char_type& c2){
if(wcsncmp(&c1, &c2, 1) < 0){
return true;
}
return false;
}
inline static char_type* move(char_type* s1, const char_type* s2, size_t n){
return (char_type*) memmove(s1, s2, n * sizeof(char_type));
}
inline static char_type* copy(char_type* s1, const char_type* s2, size_t n){
for(unsigned long int i=0; i< n; ++i){
assign(s1[i], s2[i]);
}
return s1 + n;
}
inline static char_type* assign(char_type* s, size_t n, char_type a){
return (char_type *)memset(s, a, n);/*FIXME*/
}
inline static int compare(const char_type* s1, const char_type* s2, size_t n){
return wcsncmp(s1, s2, n);
}
inline static size_t length(const char_type* s){
return wcslen(s);
}
static const char_type* find(const char_type* s, int n, const char_type& a);
inline static char_type eos() { return 0; }
inline static int_type eof() { return WEOF; }
inline static int_type not_eof(const int_type & i) {
if(i == WEOF){
return (int_type)0;
} else {
return i;
}
}
static state_type get_state(pos_type){
state_type a;
return a;
}
};
#endif
}
#endif
branches/xZenu/src/modules/MakeInc.dir
7676
7777
7878
79
79
8080
8181
8282
83
83
8484
8585
8686
......
9292
9393
9494
95
95
9696
9797
9898
99
10099
101100
102
103
104
101
102
103
105104
106105
107106
......
109108
110109
111110
112
111
112
113113
114114
115
116
117
118
119
120
121
122
123
124
125
115
116
126117
127118
128119
......
137128
138129
139130
140
131
141132
142133
143134
144
135
145136
146
147
148137
149138
150139
ifeq ($(BUILT_IN),yes)
####### Make this *BUILT IN* ######
all: ${OBJROOT} dylib_LINKER
all: ${OBJROOT} ${MODULE_OBJECTS}
else
####### Don't build in module ######
all:
all: ${OBJROOT} dylib_LINKER
endif
else
endif
dylib_LINKER: ${OBJROOT} $(SYMROOT)/boot_modules.c $(SYMROOT)/boot_modules.h dylib
dylib_LINKER: ${OBJROOT} $(SYMROOT)/boot_modules.c $(SYMROOT)/boot_modules.h $(SYMROOT)/$(MODULE_NAME).${ARCH}.linker.dylib
dylib: ${OBJROOT} $(SYMROOT)/$(MODULE_NAME).${ARCH}.dylib
ifeq ($(BUILT_IN),yes)
###### Build module into the code binary ######
$(SYMROOT)/$(MODULE_NAME).${ARCH}.dylib: $(MODULE_DEPENDENCIES) ${MODULE_OBJECTS} $(OBJROOT)/$(MODULE_NAME).desc $(OBJROOT)/$(MODULE_NAME).author Makefile
@echo "\t[LD:${ARCH}] $(MODULE_NAME).${ARCH}.dylib"
ld -arch ${ARCH} -undefined dynamic_lookup \
$(SYMROOT)/$(MODULE_NAME).${ARCH}.linker.dylib: $(MODULE_DEPENDENCIES) ${MODULE_OBJECTS} $(OBJROOT)/$(MODULE_NAME).desc $(OBJROOT)/$(MODULE_NAME).author Makefile
@ld -arch ${ARCH} \
-alias _$(MODULE_START) start \
-dylib -read_only_relocs suppress \
-S -x -Z -dead_strip_dylibs \
-no_uuid \
-final_output $(MODULE_NAME) \
$(filter %.${ARCH}o,$^) \
${DYLIB_O} \
-macosx_version_min 10.5 \
-weak_library $(ROOT)/obj/${ARCH}/boot2/Symbols_LINKER_ONLY.dylib \
$(MODULE_DEPENDENCIES_CMD) \
-sectcreate __INFO __author $(OBJROOT)/$(MODULE_NAME).author \
-sectcreate __INFO __description $(OBJROOT)/$(MODULE_NAME).desc \
-o $(SYMROOT)/$(MODULE_NAME).${ARCH}.dylib
@#@echo "\t[LIPO] $(@F)"
@#@lipo -create -arch i386 $(SYMROOT)/$(MODULE_NAME).i386.dylib \
@# -arch ppc $(SYMROOT)/$(MODULE_NAME).ppc.dylib \
@# -arch ${ARM_ARCH} $(SYMROOT)/$(MODULE_NAME).arm.dylib \
@# -output $(SYMROOT)/$(MODULE_NAME).dylib
@#@rm $(SYMROOT)/$(MODULE_NAME).i386.dylib $(SYMROOT)/$(MODULE_NAME).ppc.dylib $(SYMROOT)/$(MODULE_NAME).arm.dylib
else
-macosx_version_min 10.6 \
-o $@
##### BUild module as a seperate module #####
$(SYMROOT)/$(MODULE_NAME).${ARCH}.dylib: $(MODULE_DEPENDENCIES) ${MODULE_OBJECTS} $(OBJROOT)/$(MODULE_NAME).desc $(OBJROOT)/$(MODULE_NAME).author $(SRCROOT)/obj/i386/boot2/Symbols_LINKER_ONLY.dylib Makefile
-final_output $(MODULE_NAME) \
$(filter %.${ARCH}o,$^) \
${DYLIB_O} \
-weak_library $(SRCROOT)/obj/i386/boot2/Symbols_LINKER_ONLY.dylib \
-weak_library $(ROOT)/obj/${ARCH}/boot2/Symbols_LINKER_ONLY.dylib \
$(MODULE_DEPENDENCIES_CMD) \
-sectcreate __INFO __author $(OBJROOT)/$(MODULE_NAME).author \
-sectcreate __INFO __description $(OBJROOT)/$(MODULE_NAME).desc \
-macosx_version_min 10.5 \
-macosx_version_min 10.6 \
-o $@
endif
#clean:
branches/xZenu/src/Makefile
66
77
88
9
9
1010
1111
1212
DSTROOT = $(ROOT)/dst
DOCROOT = $(ROOT)/doc
SUBDIRS=util modules arch
SUBDIRS=util arch modules
all:
@echo ================= make $@ BUILT_IN=yes for modules arch $(ARCH) =================
branches/xZenu/src/arch/ppc/Make.rules
44
55
66
7
7
88
99
1010
TARGET_CPP = /usr/bin/g++-4.2
TARGET_SDK = /Developer/SDKs/MacOSX10.5.sdk/
TARGET_CFLAGS += -I"$(TARGET_SDK)/usr/include"
#TARGET_CFLAGS += -I"$(TARGET_SDK)/usr/include"
TARGET_LDFLAGS += -L"$(TARGET_SDK)/usr/lib"
TARGET_LDFLAGS += -L"$(TARGET_SDK)/usr/lib/system/"
TARGET_LDFLAGS += -F"$(TARGET_SDK)/System/Library/Frameworks"
branches/xZenu/src/arch/i386/boot2/Makefile
6767
6868
6969
70
7170
7271
7372
7473
7574
76
75
7776
7877
7978
......
8685
8786
8887
89
88
9089
9190
9291
......
107106
108107
109108
110
111
112109
113110
114111
......
126123
127124
128125
129
130126
131127
132128
133129
134130
135131
136
132
137133
138134
139135
-nostdlib -arch ${ARCH} -static \
-o $(SYMROOT)/boot.sys $(filter %.o,$^) `find $(OBJROOT)/../../boot2_modules/ -name \*.${ARCH}o` $(LIBS)
ifeq (${CONFIG_MODULES}, y)
@cp $(SYMROOT)/boot.sys $(SYMROOT)/boot2.sys
@# Generate the Symbols.dylib file
@echo "\t[dyldsymboltool] Symbols.dylib"
@$(SYMROOT)/dyldsymboltool $(SYMROOT)/boot.sys $(SYMROOT)/${SYMBOLS_MODULE}
@$(SYMROOT)/../util/dyldsymboltool.${ARCH} $(SYMROOT)/boot.sys $(SYMROOT)/${SYMBOLS_MODULE}
@echo "\t[LD] boot.sys"
@$(CC) -static -Wl,-preload -Wl,-segaddr,__INIT,$(BOOT2ADDR) \
@# Generate the Symbols.dylib file
@echo "\t[dyldsymboltool] Symbols.dylib"
@$(SYMROOT)/dyldsymboltool $(SYMROOT)/boot.sys $(SYMROOT)/${SYMBOLS_MODULE}
@$(SYMROOT)/../util/dyldsymboltool.${ARCH} $(SYMROOT)/boot.sys $(SYMROOT)/${SYMBOLS_MODULE}
@${RM} $(SYMROOT)/boot.sys
@echo "\t[LD] boot.sys"
-macosx_version_min 10.6 \
-o $(OBJROOT)/Symbols_LINKER_ONLY.dylib
endif
@# this is done in a sub process after boot.sys exists so the strings are populated correctly
@make embed_symbols
fi)
embed_symbols:
ifeq (${CONFIG_MODULES}, y)
@echo ================= Embedding Symbols.dylib =================
@echo "\t[MACHOCONV] boot"
@${MACHOCONV} $(SYMROOT)/boot2.sys $(SYMROOT)/boot &> /dev/null
@echo "\t******* Patching at $(PATCH_ADDR) ******"
@stat -f%z $(SYMROOT)/boot | perl -ane "print pack('V',@F[0]);" | dd conv=notrunc of=${SYMROOT}/boot.sys bs=1 count=4 seek=$(PATCH_ADDR) &> /dev/null
endif
@echo "\t[MACHOCONV] boot"
@${MACHOCONV} $(SYMROOT)/boot.sys $(SYMROOT)/boot

Archive Download the corresponding diff file

Revision: 1272