Chameleon

Chameleon Commit Details

Date:2010-08-10 04:56:34 (13 years 8 months ago)
Author:Evan Lojewski
Commit:338
Parents: 337
Message:Modules can not depend on each other. Modules can be linked using the -weak-libary cmmand in ld. Untested.
Changes:
M/branches/meklort/i386/modules/Makefile
M/branches/meklort/i386/modules/Symbols/Makefile
M/branches/meklort/i386/boot2/modules.c
M/branches/meklort/i386/modules/HelloWorld/HelloWorld.c
M/branches/meklort/i386/modules/HelloWorld/Makefile
M/branches/meklort/i386/boot2/modules.h

File differences

branches/meklort/i386/boot2/modules.c
99
1010
1111
12
13
1214
1315
1416
......
1719
1820
1921
22
23
24
25
26
27
28
2029
2130
2231
......
6574
6675
6776
68
6977
7078
7179
......
7583
7684
7785
78
86
7987
80
8188
82
83
84
85
86
87
88
89
90
91
92
93
94
95
8996
9097
9198
......
114121
115122
116123
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210124
211
212125
213126
214127
......
217130
218131
219132
220
133
221134
222135
223136
......
226139
227140
228141
229
230
142
143
231144
232145
233146
......
235148
236149
237150
238
151
239152
240153
241154
242155
243156
244
157
245158
246159
247160
......
264177
265178
266179
267
180
181
182
183
184
185
268186
269187
270188
......
289207
290208
291209
292
293
294
295
296210
297
298
299
300
301
302
303
304211
305
306
307
308
212
309213
310
311
312
313214
314215
315216
......
323224
324225
325226
227
326228
229
230
231
232
233
234
327235
328
329
236
237
238
239
330240
331
332
333
334
335
241
242
243
244
336245
337246
338
339
340247
248
249
341250
342251
343252
344
345
346
347
348
349
350
351
352
353253
354254
355255
......
547447
548448
549449
550
551
552450
553451
554452
......
559457
560458
561459
562
460
563461
564462
565463
566464
567465
466
568467
569468
570469
......
618517
619518
620519
621
520
622521
623522
624523
......
825724
826725
827726
828
727
829728
830
729
831730
832731
833732
834733
835
734
836735
837736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
838762
839763
840764
841765
842766
843
844
845
767
846768
847
769
848770
771
849772
850773
851774
......
854777
855778
856779
857
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
858807
859808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
#include "modules.h"
moduleList_t* loadedModules = NULL;
symbolList_t* moduleSymbols = NULL;
unsigned int (*lookup_symbol)(const char*) = NULL;
int load_module(const char* module)
{
// Check to see if the module has already been loaded
if(is_module_laoded(module))
{
printf("Module %s already loaded\n");
return 1;
}
char modString[128];
int fh = -1;
sprintf(modString, "/Extra/modules/%s.dylib", module);
void* parse_mach(void* binary)
{
int (*module_init)(void) = NULL;
void (*module_start)(void) = NULL;
char* symbolStub = NULL;
char* nonlazy = NULL;
char* nonlazy_variables = NULL;
//char* nonlazy_variables = NULL;
char* symbolTable = NULL;
// TODO convert all of the structs a union
struct load_command *loadCommand;
struct dylib_command* dylibCommand;
struct dyld_info_command* dyldInfoCommand;
struct symtab_command* symtabCommand;
struct segment_command* segmentCommand;
struct dysymtab_command* dysymtabCommand;
struct section* section;
struct load_command *loadCommand = NULL;
struct dylib_command* dylibCommand = NULL;
struct dyld_info_command* dyldInfoCommand = NULL;
struct symtab_command* symtabCommand = NULL;
struct segment_command* segmentCommand = NULL;
struct dysymtab_command* dysymtabCommand = NULL;
struct section* section = NULL;
UInt32 binaryIndex = sizeof(struct mach_header);
UInt16 cmd = 0;
{
case LC_SYMTAB:
symtabCommand = binary + binaryIndex;
UInt32 symbolIndex = 0;
char* symbolString = (UInt32)binary + (char*)symtabCommand->stroff;
symbolTable = binary + symtabCommand->symoff;
int externalIndex = 0;
while(symbolIndex < symtabCommand->nsyms)
{
struct nlist* symbolEntry = binary + symtabCommand->symoff + (symbolIndex * sizeof(struct nlist));
// If the symbol is exported by this module
if(symbolEntry->n_value)
{
if(strcmp(symbolString + symbolEntry->n_un.n_strx, "_start") == 0)
{
// Module init located. Don't register it, only called once
module_init = binary + symbolEntry->n_value;
}
else if(strcmp(symbolString + symbolEntry->n_un.n_strx, "start") == 0)
{
// Module start located. Start is an alias so don't register it
module_start = binary + symbolEntry->n_value;
}
else
{
add_symbol(symbolString + symbolEntry->n_un.n_strx, binary + symbolEntry->n_value);
}
}
// External symbol
else if(symbolEntry->n_type & 0x01 && symbolStub)
{
printf("Located external symbol %s", symbolString + symbolEntry->n_un.n_strx);
printf(" stub at 0x%X, (0x%X)\n", symbolStub + STUB_ENTRY_SIZE * externalIndex - (UInt32)binary, symbolStub + STUB_ENTRY_SIZE * externalIndex);
getc();
// Patch stub
if(lookup_symbol == NULL)
{
printf("Symbol.dylib not loaded. Module loader not setup.\n");
return NULL;
}
else
{
void* symbolAddress = (void*)lookup_symbol(symbolString + symbolEntry->n_un.n_strx);
if((0xFFFFFFFF == (UInt32)symbolAddress) &&
strcmp(symbolString + symbolEntry->n_un.n_strx, SYMBOL_DYLD_STUB_BINDER) != 0)
{
printf("Unable to locate symbol %s\n", symbolString + symbolEntry->n_un.n_strx);
}
else
{
char* patchLocation = symbolStub + STUB_ENTRY_SIZE * externalIndex;
//patch with far jump ;
/*
printf("0x%X 0x%X 0x%X 0x%X 0x%X 0x%X\n",
patchLocation[0],
patchLocation[1],
patchLocation[2],
patchLocation[3],
patchLocation[4],
patchLocation[5]);
*/
// Point the symbol stub to the nonlazy pointers
patchLocation[0] = 0xFF;// Should already be this
patchLocation[1] = 0x25;// Should already be this
patchLocation[2] = ((UInt32)(nonlazy + externalIndex * 4) & 0x000000FF) >> 0;
patchLocation[3] = ((UInt32)(nonlazy + externalIndex * 4) & 0x0000FF00) >> 8;
patchLocation[4] = ((UInt32)(nonlazy + externalIndex * 4) & 0x00FF0000) >> 16;
patchLocation[5] = ((UInt32)(nonlazy + externalIndex * 4) & 0xFF000000) >> 24;
// Set the nonlazy pointer to the correct address
patchLocation = (nonlazy + externalIndex*4);
patchLocation[0] =((UInt32)symbolAddress & 0x000000FF) >> 0;
patchLocation[1] =((UInt32)symbolAddress & 0x0000FF00) >> 8;
patchLocation[2] =((UInt32)symbolAddress & 0x00FF0000) >> 16;
patchLocation[3] =((UInt32)symbolAddress & 0xFF000000) >> 24;
externalIndex++;
}
}
}
symbolEntry+= sizeof(struct nlist);
symbolIndex++;// TODO remove
}
break;
case LC_SEGMENT:
segmentCommand = binary + binaryIndex;
while(sections)
{
// Look for the __symbol_stub section
if(strcmp(section->sectname, "__nl_symbol_ptr") == 0)
if(strcmp(section->sectname, SECT_NON_LAZY_SYMBOL_PTR) == 0)
{
/*printf("\tSection non lazy pointers at 0x%X, %d symbols\n",
section->offset,
switch(section->flags)
{
case S_NON_LAZY_SYMBOL_POINTERS:
nonlazy_variables = binary + section->offset;
break;
//nonlazy_variables = binary + section->offset;
break;
case S_LAZY_SYMBOL_POINTERS:
nonlazy = binary + section->offset;
break;
default:
printf("Unhandled __nl_symbol_ptr section\n");
printf("Unhandled %s section\n", SECT_NON_LAZY_SYMBOL_PTR);
getc();
break;
}
//getc();
}
else if(strcmp(section->sectname, "__symbol_stub") == 0)
else if(strcmp(section->sectname, SECT_SYMBOL_STUBS) == 0)
{
/*printf("\tSection __symbol_stub at 0x%X (0x%X), %d symbols\n",
section->offset,
break;
case LC_LOAD_DYLIB:
//printf("Unhandled loadcommand LC_LOAD_DYLIB\n");
case LC_LOAD_WEAK_DYLIB:
{
// TODO: do this before
struct dylib_command* weakLoad = binary + binaryIndex;
load_module((char*)((UInt32)*((UInt32*)&weakLoad->dylib.name)));
}
break;
case LC_ID_DYLIB:
dyldInfoCommand->lazy_bind_off,
dyldInfoCommand->export_off);
*/
if(dyldInfoCommand->bind_off)
{
bind_macho(binary, (char*)dyldInfoCommand->bind_off, dyldInfoCommand->bind_size);
}
/*
// This is done later on using the __symbol_stub instead
if(dyldInfoCommand->lazy_bind_off)
{
bind_macho(binary, (char*)dyldInfoCommand->lazy_bind_off, dyldInfoCommand->lazy_bind_size);
}*/
if(dyldInfoCommand->rebase_off)
{
rebase_macho(binary, (char*)dyldInfoCommand->rebase_off, dyldInfoCommand->rebase_size);
}
break;
break;
case LC_UUID:
// We don't care about the UUID at the moment
break;
binaryIndex += cmdSize;
}
if(!moduleName) return NULL;
// Module is loaded and all module dependencies have been loaded, bind the module
// NOTE: circular dependencies are not handled yet
if(dyldInfoCommand && dyldInfoCommand->bind_off)
{
bind_macho(binary, (char*)dyldInfoCommand->bind_off, dyldInfoCommand->bind_size);
}
// TODO: Initialize the module.
printf("Calling _start\n");
if(dyldInfoCommand && dyldInfoCommand->rebase_off)
{
rebase_macho(binary, (char*)dyldInfoCommand->rebase_off, dyldInfoCommand->rebase_size);
}
getc();
if(module_init)
{
jump_pointer(module_init);
}
module_start = (void*)handle_symtable((UInt32)binary, symtabCommand, symbolStub, nonlazy);
// To satisfy cicular deps, the module_loaded command shoudl be run before the module init();
module_loaded(moduleName, moduleVersion, moduleCompat);
getc();
//*/
return module_start; // TODO populate w/ address of _start
return module_start;
}
// This is for debugging, remove the jump_pointer funciton later
int jump_pointer(int (*pointer)())
{
printf("Jumping to function at 0x%X\n", pointer);
getc();
return (*pointer)();
}
// Based on code from dylibinfo.cpp and ImageLoaderMachOCompressed.cpp
void rebase_macho(void* base, char* rebase_stream, UInt32 size)
{
// however the macho file is 32 bit, so it shouldn't matter too much
void bind_macho(void* base, char* bind_stream, UInt32 size)
{
bind_stream += (UInt32)base;
UInt8 immediate = 0;
UInt32 address = 0;
SInt32 addend = 0;
SInt32 addend = 0;// TODO: handle this
SInt32 libraryOrdinal = 0;
const char* symbolName = NULL;
UInt8 symboFlags = 0;
UInt32 symbolAddr = 0xFFFFFFFF;
// Temperary variables
UInt8 bits = 0;
UInt32 tmp = 0;
i += strlen((char*)&bind_stream[i]);
//printf("BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM: %s, 0x%X\n", symbolName, symboFlags);
symbolAddr = lookup_symbol(symbolName);
symbolAddr = lookup_external_all(symbolName);
break;
* TODO: actualy do something...
* possibly change to a pointer and add this to the Symbol module
*/
void add_symbol(const char* symbol, void* addr)
void add_symbol(char* symbol, void* addr)
{
printf("Adding symbol %s at 0x%X\n", symbol, addr);
//printf("Adding symbol %s at 0x%X\n", symbol, addr);
//hack
if(strcmp(symbol, "_lookup_symbol") == 0)
{
printf("Initializing lookup symbol function\n");
//printf("Initializing lookup symbol function\n");
lookup_symbol = addr;
}
else if(!moduleSymbols)
{
moduleSymbols = malloc(sizeof(symbolList_t));
moduleSymbols->next = NULL;
moduleSymbols->addr = (unsigned int)addr;
moduleSymbols->symbol = symbol;
}
else
{
symbolList_t* entry = moduleSymbols;
while(entry->next)
{
entry = entry->next;
}
entry->next = malloc(sizeof(symbolList_t));
entry = entry->next;
entry->next = NULL;
entry->addr = (unsigned int)addr;
entry->symbol = symbol;
}
}
/*
* print out the information about the loaded module
* In the future, add to a list of laoded modules
* so that if another module depends on it we don't
* try to reload the same module.
*/
void module_loaded(const char* name, UInt32 version, UInt32 compat)
void module_loaded(char* name, UInt32 version, UInt32 compat)
{
/*
printf("\%s.dylib Version %d.%d.%d loaded\n"
"\tCompatibility Version: %d.%d.%d\n",
name,
(version >> 0) & 0x00FF,
(compat >> 16) & 0xFFFF,
(compat >> 8) & 0x00FF,
(compat >> 0) & 0x00FF);
(compat >> 0) & 0x00FF);
*/
if(loadedModules == NULL)
{
loadedModules = malloc(sizeof(moduleList_t));
loadedModules->next = NULL;
loadedModules->module = name;
loadedModules->version = version;
loadedModules->compat = compat;
}
else
{
moduleList_t* entry = loadedModules;
while(entry->next)
{
entry = entry->next;
}
entry->next = malloc(sizeof(moduleList_t));
entry = entry->next;
entry->next = NULL;
entry->module = name;
entry->version = version;
entry->compat = compat;
}
}
int is_module_laoded(const char* name)
{
moduleList_t* entry = loadedModules;
while(entry)
{
if(strcmp(entry->module, name) == 0)
{
return 1;
}
else
{
entry = entry->next;
}
}
return 0;
}
// Look for symbols using the Smbols moduel function.
// If non are found, look through the list of module symbols
unsigned int lookup_external_all(const char* name)
{
unsigned int addr = 0xFFFFFFFF;
if(lookup_symbol)
{
addr = lookup_symbol(name);
if(addr != 0xFFFFFFFF)
{
return addr;
}
}
else
{
printf("Symbol.dylib not loaded. Module loader not setup.\n");
return 0xFFFFFFFF;
}
symbolList_t* entry = moduleSymbols;
while(entry)
{
if(strcmp(entry->symbol, name) == 0)
{
return entry->addr;
}
else
{
entry = entry->next;
}
}
return 0xFFFFFFFF;
}
/*
* parse the symbol table
* Lookup any undefined symbols
*/
unsigned int handle_symtable(UInt32 base, struct symtab_command* symtabCommand, char* symbolStub, char* nonlazy)
{
unsigned int module_start = 0xFFFFFFFF;
UInt32 symbolIndex = 0;
char* symbolString = base + (char*)symtabCommand->stroff;
//char* symbolTable = base + symtabCommand->symoff;
int externalIndex = 0;
while(symbolIndex < symtabCommand->nsyms)
{
struct nlist* symbolEntry = (void*)base + symtabCommand->symoff + (symbolIndex * sizeof(struct nlist));
// If the symbol is exported by this module
if(symbolEntry->n_value)
{
if(strcmp(symbolString + symbolEntry->n_un.n_strx, "start") == 0)
{
// Module start located. Start is an alias so don't register it
module_start = base + symbolEntry->n_value;
}
else
{
add_symbol(symbolString + symbolEntry->n_un.n_strx, (void*)base + symbolEntry->n_value);
}
}
// External symbol
else if(symbolEntry->n_type & 0x01 && symbolStub)
{
printf("Located external symbol %s", symbolString + symbolEntry->n_un.n_strx);
printf(" stub at 0x%X, (0x%X)\n", symbolStub + STUB_ENTRY_SIZE * externalIndex - base, symbolStub + STUB_ENTRY_SIZE * externalIndex);
getc();
// Patch stub
void* symbolAddress = (void*)lookup_external_all(symbolString + symbolEntry->n_un.n_strx);
if((0xFFFFFFFF == (UInt32)symbolAddress) &&
strcmp(symbolString + symbolEntry->n_un.n_strx, SYMBOL_DYLD_STUB_BINDER) != 0)
{
printf("Unable to locate symbol %s\n", symbolString + symbolEntry->n_un.n_strx);
}
else
{
char* patchLocation = symbolStub + STUB_ENTRY_SIZE * externalIndex;
//patch with far jump ;
/*
printf("0x%X 0x%X 0x%X 0x%X 0x%X 0x%X\n",
patchLocation[0],
patchLocation[1],
patchLocation[2],
patchLocation[3],
patchLocation[4],
patchLocation[5]);
*/
// Point the symbol stub to the nonlazy pointers
// TODO: do this *after* each module dep has been laoded.
// At the moment, module deps won't work
patchLocation[0] = 0xFF;// Should already be this
patchLocation[1] = 0x25;// Should already be this
patchLocation[2] = ((UInt32)(nonlazy + externalIndex * 4) & 0x000000FF) >> 0;
patchLocation[3] = ((UInt32)(nonlazy + externalIndex * 4) & 0x0000FF00) >> 8;
patchLocation[4] = ((UInt32)(nonlazy + externalIndex * 4) & 0x00FF0000) >> 16;
patchLocation[5] = ((UInt32)(nonlazy + externalIndex * 4) & 0xFF000000) >> 24;
// Set the nonlazy pointer to the correct address
patchLocation = (nonlazy + externalIndex*4);
patchLocation[0] =((UInt32)symbolAddress & 0x000000FF) >> 0;
patchLocation[1] =((UInt32)symbolAddress & 0x0000FF00) >> 8;
patchLocation[2] =((UInt32)symbolAddress & 0x00FF0000) >> 16;
patchLocation[3] =((UInt32)symbolAddress & 0xFF000000) >> 24;
externalIndex++;
}
}
symbolEntry+= sizeof(struct nlist);
symbolIndex++;// TODO remove
}
return module_start;
}
branches/meklort/i386/boot2/modules.h
88
99
1010
11
12
13
14
15
16
17
18
19
20
21
22
23
1124
1225
1326
1427
28
1529
1630
1731
32
33
34
1835
1936
2037
38
39
40
2141
42
43
2244
23
45
2446
25
26
27
28
47
2948
3049
#include <mach-o/nlist.h>
typedef struct symbolList_t{
char* symbol;
unsigned int addr;
struct symbolList_t* next;
} symbolList_t;
typedef struct moduleList_t{
char* module;
unsigned int version;
unsigned int compat;
struct moduleList_t* next;
} moduleList_t;
#ifndef __BOOT_MODULES_H
#define __BOOT_MODULES_H
#define SYMBOLS_MODULE "Symbols"
#define SYMBOL_DYLD_STUB_BINDER"dyld_stub_binder"
#define STUB_ENTRY_SIZE6
#define SECT_NON_LAZY_SYMBOL_PTR"__nl_symbol_ptr"
#define SECT_SYMBOL_STUBS"__symbol_stub"
#define SUCCESS1
#defineERROR0
int load_module(const char* module);
int is_module_laoded(const char* name);
void module_loaded(char* name, UInt32 version, UInt32 compat);
void add_symbol(char* symbol, void* addr);
void* parse_mach(void* binary);
int jump_pointer(int (*pointer)());
unsigned int handle_symtable(UInt32 base, struct symtab_command* symtabCommand, char* symbolStub, char* nonlazy);
int load_module(const char* module);
void module_loaded(const char* name, UInt32 version, UInt32 compat);
void add_symbol(const char* symbol, void* addr);
void* parse_mach(void* binary);
unsigned int lookup_external_all(const char* name);
#endif /* __BOOT_MODULES_H */
branches/meklort/i386/modules/Symbols/Makefile
6565
6666
6767
68
68
6969
7070
7171
......
8383
8484
8585
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
10486
10587
10688
-bind_at_load \
-current_version $(MODULE_VERSION) -compatibility_version `svn info ../../ | grep Revision | awk '{print $$2}'` \
-final_output $(MODULE_NAME) \
$(OBJROOT)/$(MODULE_NAME)Init.o $(OBJROOT)/Symbols.o -o $(SYMROOT)/$(MODULE_NAME).dylib \
$(OBJROOT)/Symbols.o -o $(SYMROOT)/$(MODULE_NAME).dylib \
@nm -g $(SYMROOT)/boot.sys | tr . _ | awk '{print "{.symbol = "$$3"_string, .addr = 0x"$$1"},";}' >> Symbols.h
@echo "};" >> Symbols.h
rm -rf $(MODULE_NAME)Init.c
echo "extern int load_dependency(const char*);" >> $(MODULE_NAME)Init.c
echo "" >> $(MODULE_NAME)Init.c
echo "int start() {" >> $(MODULE_NAME)Init.c
echo "int returnValue = 1;" >> $(MODULE_NAME)Init.c
for i in ${MODULE_DEPENDENCIES}; \
do \
echo Adding dependency $$i.dylib; \
echo "if(returnValue) returnValue &= load_dependency(\""$$i"\");" >> $(MODULE_NAME)Init.c; \
done
echo "return returnValue;" >> $(MODULE_NAME)Init.c;
echo "}" >> $(MODULE_NAME)Init.c;
$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c $(MODULE_NAME)Init.c $(INC) -o $(OBJROOT)/$(MODULE_NAME)Init.o
$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c Symbols.c $(INC) -o $(OBJROOT)/Symbols.o
Symbols.h:
branches/meklort/i386/modules/HelloWorld/HelloWorld.c
55
66
77
8
89
910
1011
12
1113
1214
#include "libsaio.h"
void Symbols_start();
void HelloWorld_start()
{
Symbols_start();
printf("Hello World from a module\n");
}
branches/meklort/i386/modules/HelloWorld/Makefile
7272
7373
7474
75
75
7676
7777
7878
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
79
9780
9881
9982
-bind_at_load \
-current_version $(MODULE_VERSION) -compatibility_version $(MODULE_COMPAT_VERSION) \
-final_output $(MODULE_NAME) \
$(OBJROOT)/$(MODULE_NAME)Init.o \
-weak_library $(SYMROOT)/Symbols.dylib \
$(OBJROOT)/HelloWorld.o -o $(SYMROOT)/$(MODULE_NAME).dylib
HelloWorld.o:
rm -rf $(MODULE_NAME)Init.c
echo "extern int load_dependency(const char*);" >> $(MODULE_NAME)Init.c
echo "" >> $(MODULE_NAME)Init.c
echo "int start() {" >> $(MODULE_NAME)Init.c
echo "int returnValue = 1;" >> $(MODULE_NAME)Init.c
for i in ${MODULE_DEPENDENCIES}; \
do \
echo Adding dependency $$i.dylib; \
echo "if(returnValue) returnValue &= load_dependency(\""$$i"\");" >> $(MODULE_NAME)Init.c; \
done
echo "return returnValue;" >> $(MODULE_NAME)Init.c;
echo "}" >> $(MODULE_NAME)Init.c;
$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c $(MODULE_NAME)Init.c $(INC) -o $(OBJROOT)/$(MODULE_NAME)Init.o
HelloWorld.o:
$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c "HelloWorld.c" $(INC) -o "$(OBJROOT)/HelloWorld.o"
include ../../MakeInc.dir
branches/meklort/i386/modules/Makefile
2626
2727
2828
29
29
3030
3131
3232
VPATH = $(OBJROOT):$(SYMROOT)
# The order of building is important.
SUBDIRS = `find ./ -type d -depth 1 -not -name ".*"`
SUBDIRS = Symbols `find ./ -type d -depth 1 -not -name ".*"`
all embedtheme tags debug install installhdrs:
@rm -rf $(OBJROOT)

Archive Download the corresponding diff file

Revision: 338