- Timestamp:
- Feb 13, 2007, 10:04:40 PM (18 years ago)
- Location:
- trunk/kLdr
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kLdr/Makefile.kmk
r2960 r2965 50 50 TEMPLATE_TST_SDKS = WINPSDK W2K3DDK 51 51 52 else 52 else 53 53 ifeq ($(BUILD_TARGET),os2) 54 54 TEMPLATE_TST_TOOL = GCC3OMF 55 55 TEMPLATE_TST_ASFLAGS = -f obj 56 56 TEMPLATE_TST_LIBS = os2 gcc end 57 else ifeq ($(BUILD_TARGET),darwin) 58 TEMPLATE_TST_TOOL = GCC4MACHO 59 TEMPLATE_TST_ASFLAGS = -f macho 60 TEMPLATE_TST_LIBS = #os2 gcc end 57 61 else 58 62 TEMPLATE_TST_TOOL = GCC3 … … 82 86 else 83 87 kLdr_TOOL = VCC80AMD64 88 kLdr_ASTOOL = YASM 84 89 kLdr_CFLAGS = -W3 -Zl -MT 85 90 kLdr_LDFLAGS = -Entry:DllMain -Debug … … 97 102 kLdr_ASFLAGS = -f obj 98 103 kLdr_LIBS = os2 gcc end 104 else ifeq ($(BUILD_TARGET),darwin) 105 kLdr_TOOL = GCC4MACHO 106 kLdr_ASFLAGS = -f macho 107 kLdr_LIBS = #os2 gcc end 99 108 else 100 109 kLdr_TOOL = GCC3 … … 216 225 -e '/^#define *\(KLDR_ERR_[^ ()]*\) .*$$/!d' \ 217 226 -e 's/^#define *\(KLDR_ERR_[^ ()]*\) .*$$/ERR_CONST(\1)/' \ 227 -e '/KLDR_ERR_BASE/d' \ 218 228 -e '/KLDR_ERR_[^_]*_BASE/d' \ 219 229 kLdr.h > $@ -
trunk/kLdr/kLdr.h
r2964 r2965 1195 1195 * @{ 1196 1196 */ 1197 #ifdef __OS2__ 1198 # define KLDR_ERR_BASE 420000 1199 #elif defined(__WIN__) 1200 # define KLDR_ERR_BASE 420000 1201 #else 1202 # error "port me" 1203 #endif 1197 1198 #define KLDR_ERR_BASE 420000 1199 1204 1200 /** The image format is unknown. */ 1205 #define KLDR_ERR_UNKNOWN_FORMAT (KLDR_ERR_BASE + 0)1201 #define KLDR_ERR_UNKNOWN_FORMAT (KLDR_ERR_BASE + 0) 1206 1202 /** The MZ image format isn't supported by this kLdr build. */ 1207 #define KLDR_ERR_MZ_NOT_SUPPORTED (KLDR_ERR_BASE + 1)1203 #define KLDR_ERR_MZ_NOT_SUPPORTED (KLDR_ERR_BASE + 1) 1208 1204 /** The NE image format isn't supported by this kLdr build. */ 1209 #define KLDR_ERR_NE_NOT_SUPPORTED (KLDR_ERR_BASE + 2)1205 #define KLDR_ERR_NE_NOT_SUPPORTED (KLDR_ERR_BASE + 2) 1210 1206 /** The LX image format isn't supported by this kLdr build. */ 1211 #define KLDR_ERR_LX_NOT_SUPPORTED (KLDR_ERR_BASE + 3)1207 #define KLDR_ERR_LX_NOT_SUPPORTED (KLDR_ERR_BASE + 3) 1212 1208 /** The LE image format isn't supported by this kLdr build. */ 1213 #define KLDR_ERR_LE_NOT_SUPPORTED (KLDR_ERR_BASE + 4)1209 #define KLDR_ERR_LE_NOT_SUPPORTED (KLDR_ERR_BASE + 4) 1214 1210 /** The PE image format isn't supported by this kLdr build. */ 1215 #define KLDR_ERR_PE_NOT_SUPPORTED (KLDR_ERR_BASE + 5)1211 #define KLDR_ERR_PE_NOT_SUPPORTED (KLDR_ERR_BASE + 5) 1216 1212 /** The ELF image format isn't supported by this kLdr build. */ 1217 #define KLDR_ERR_ELF_NOT_SUPPORTED (KLDR_ERR_BASE + 6)1213 #define KLDR_ERR_ELF_NOT_SUPPORTED (KLDR_ERR_BASE + 6) 1218 1214 /** The mach-o image format isn't supported by this kLdr build. */ 1219 #define KLDR_ERR_MACHO_NOT_SUPPORTED (KLDR_ERR_BASE + 7)1215 #define KLDR_ERR_MACHO_NOT_SUPPORTED (KLDR_ERR_BASE + 7) 1220 1216 /** The FAT image format isn't supported by this kLdr build or 1221 1217 * a direct open was attempt without going thru the FAT file provider. 1222 1218 * FAT images are also known as Universal Binaries. */ 1223 #define KLDR_ERR_FAT_NOT_SUPPORTED (KLDR_ERR_BASE + 8)1219 #define KLDR_ERR_FAT_NOT_SUPPORTED (KLDR_ERR_BASE + 8) 1224 1220 /** The a.out image format isn't supported by this kLdr build. */ 1225 #define KLDR_ERR_AOUT_NOT_SUPPORTED (KLDR_ERR_BASE + 9)1221 #define KLDR_ERR_AOUT_NOT_SUPPORTED (KLDR_ERR_BASE + 9) 1226 1222 1227 1223 /** Invalid parameter to a kLdr API. */ -
trunk/kLdr/testcase/Makefile.kmk
r2960 r2965 60 60 61 61 else 62 TEMPLATE_TST_CFLAGS = -Wall -pedantic -g 63 TEMPLATE_TST_CFLAGS.release = -O2 64 TEMPLATE_TST_LDFLAGS = 62 65 ifneq ($(filter os2,$(BUILD_TARGET)),) 63 66 TEMPLATE_TST_TOOL = GCC3OMF 64 67 TEMPLATE_TST_ASFLAGS = -f obj 65 68 TEMPLATE_TST_LIBS = os2 gcc end 69 else ifneq ($(filter darwin,$(BUILD_TARGET)),) 70 TEMPLATE_TST_TOOL = GCC4MACHO 71 TEMPLATE_TST_ASFLAGS = -f macho 72 TEMPLATE_TST_DEFS = __DARWIN__ 73 TEMPLATE_TST_LIBS = 66 74 else 67 75 TEMPLATE_TST_TOOL = GCC3 … … 69 77 TEMPLATE_TST_LIBS = gcc 70 78 endif 71 TEMPLATE_TST_CFLAGS = -Wall -pedantic -g72 TEMPLATE_TST_CFLAGS.release = -O273 TEMPLATE_TST_LDFLAGS =74 79 endif 75 80 TEMPLATE_TST_INCS = . .. … … 101 106 102 107 else 103 ifneq ($(filter os2,$(BUILD_TARGET)),) 108 TEMPLATE_TSTBARE_CFLAGS = -Wall -pedantic -g 109 TEMPLATE_TSTBARE_CFLAGS.release = -O2 110 TEMPLATE_TSTBARE_LDFLAGS = -nostdlib -lgcc 111 ifeq ($(filter-out os2,$(BUILD_TARGET)),) 104 112 TEMPLATE_TSTBARE_TOOL = GCC3OMF 105 113 TEMPLATE_TSTBARE_ASFLAGS = -f obj … … 107 115 TEMPLATE_TSTBARE_DEFS = main=main_wrapped 108 116 TEMPLATE_TSTBARE_LIBS = os2 117 else ifeq ($(filter-out darwin,$(BUILD_TARGET)),) 118 TEMPLATE_TSTBARE_TOOL = GCC4MACHO 119 TEMPLATE_TSTBARE_ASFLAGS = -f macho 120 TEMPLATE_TSTBARE_ASTOOL = NASM 121 TEMPLATE_TSTBARE_DEFS = __DARWIN__ 122 TEMPLATE_TSTBARE_LIBS = 123 TEMPLATE_TSTBARE_CFLAGS += -static 124 TEMPLATE_TSTBARE_LDFLAGS += -nostdlib -r 109 125 else 110 126 TEMPLATE_TSTBARE_TOOL = GCC3 … … 112 128 TEMPLATE_TSTBARE_LIBS = gcc 113 129 endif 114 TEMPLATE_TSTBARE_CFLAGS = -Wall -pedantic -g115 TEMPLATE_TSTBARE_CFLAGS.release = -O2116 TEMPLATE_TSTBARE_LDFLAGS = -nostdlib -lgcc117 130 endif 118 131 TEMPLATE_TSTBARE_INCS = . .. … … 129 142 TEMPLATE_TSTBAREDLL = Bare bone testcase dll template 130 143 TEMPLATE_TSTBAREDLL_EXTENDS = TSTBARE 131 ifneq ($(filter win nt win32 win64,$(BUILD_TARGET)),) 132 TEMPLATE_TSTBAREDLL_LDFLAGS += -Entry:DllMain 133 else 144 ifeq ($(BUILD_TARGET),win) 145 TEMPLATE_TSTBAREDLL_LDFLAGS += -Entry:DllMain 146 else ifeq ($(BUILD_TARGET),darwin) 147 # TEMPLATE_TSTBAREDLL_CFLAGS += -dynamiclib 148 # TEMPLATE_TSTBAREDLL_LDFLAGS += -dynamiclib 134 149 endif 135 150 … … 168 183 tst-0_SOURCES.os2= tstExeMainStub-os2.asm 169 184 170 ifeq ($( filter-out nt win win32 win64,$(BUILD_TARGET)),)185 ifeq ($(BUILD_TARGET),win) 171 186 tst-0-driver_LIBS= $(PATH_LIB)/kLdr.lib 172 187 tst-0-a_LIBS = $(PATH_TARGET)/tst-0-d/tst-0-d.lib … … 175 190 tst-0_LIBS = $(TARGET_tst-0-a:.dll=.lib) $(TARGET_tst-0-b:.dll=.lib) $(TARGET_tst-0-c:.dll=.lib) 176 191 else 177 tst-0-driver_LIBS .os2 = $(PATH_DLL)/kLdr.dll192 tst-0-driver_LIBS= $(PATH_DLL)/kLdr$(SUFF_DLL) 178 193 tst-0-a_LIBS = $(subst -a,-d,$(TARGET_tst-0-a)) 179 194 tst-0-b_LIBS = $(subst -b,-d,$(TARGET_tst-0-b)) … … 204 219 tst-1_SOURCES = tst-1.c 205 220 206 ifeq ($( filter-out nt win win32 win64,$(BUILD_TARGET)),)221 ifeq ($(BUILD_TARGET),win) 207 222 tst-1-a_LIBS = $(PATH_TARGET)/tst-1-d/tst-1-d.lib 208 223 tst-1-b_LIBS = $(PATH_TARGET)/tst-1-d/tst-1-d.lib … … 238 253 tst-2_SOURCES = tst-2.c 239 254 240 ifeq ($( filter-out nt win win32 win64,$(BUILD_TARGET)),)255 ifeq ($(BUILD_TARGET),win) 241 256 tst-2-b_LIBS = $(PATH_TARGET)/tst-2-a/tst-2-a.lib 242 257 tst-2-c_LIBS = $(PATH_TARGET)/tst-2-a/tst-2-a.lib … … 251 266 252 267 268 # 269 # tst-3: Single module. 270 # 271 PROGRAMS += tst-3-driver 272 DLLS += tst-3 273 274 tst-3_TEMPLATE = TSTBAREDLL 275 tst-3_SOURCES = tst-3.c tstDllMainStub.c 276 tst-3_SOURCES.os2= tstDllMainStub-os2.asm 277 278 tst-3-driver_TEMPLATE = TSTPROG 279 tst-3-driver_SOURCES = tst-3-driver.c 280 281 ifeq ($(BUILD_TARGET),win) 282 tst-3-driver_LIBS = $(PATH_LIB)/kLdr.lib 283 else 284 tst-3-driver_LIBS = $(PATH_DLL)/kLdr$(SUFF_DLL) 285 endif 286 253 287 254 288 # generate rules. -
trunk/kLdr/testcase/tst-0-driver.c
r2878 r2965 61 61 g_cErrors++; 62 62 63 printf("tst LdrMod: ");63 printf("tst-0-driver: "); 64 64 va_start(va, pszFormat); 65 65 vprintf(pszFormat, va); -
trunk/kLdr/testcase/tst.h
r2885 r2965 42 42 #endif 43 43 44 #if defined(__OS2__) 44 #if defined(__OS2__) || defined(__DARWIN__) 45 45 # define MY_NAME(a) "_" a 46 46 #else -
trunk/kLdr/testcase/tstDllMain.c
r2885 r2965 40 40 # include <string.h> 41 41 42 #elif defined(__DARWIN__) 43 # include <unistd.h> 44 # include <string.h> 45 42 46 #else 43 47 # error "port me" 44 48 #endif 45 49 50 46 51 /******************************************************************************* 47 52 * Internal Functions * 48 53 *******************************************************************************/ 49 staticvoid tstWrite(const char *psz);54 void tstWrite(const char *psz); 50 55 51 56 … … 120 125 } 121 126 127 #elif defined(__DARWIN__) 128 /* later */ 129 122 130 #else 123 131 # error "port me" … … 130 138 * @param pszMsg The string. 131 139 */ 132 staticvoid tstWrite(const char *pszMsg)140 void tstWrite(const char *pszMsg) 133 141 { 134 142 #if defined(__OS2__) || defined(__WIN__) … … 171 179 } 172 180 181 #elif defined(__DARWIN__) 182 write(STDERR_FILENO, pszMsg, strlen(pszMsg)); 183 173 184 #else 174 185 # error "port me" -
trunk/kLdr/testcase/tstDllMainStub.c
r2878 r2965 38 38 # include <windows.h> 39 39 40 #elif defined(__DARWIN__) 41 /* later */ 42 40 43 #else 41 44 # error "port me" … … 62 65 } 63 66 67 #elif defined(__DARWIN__) 68 /* later */ 69 64 70 #else 65 71 # error "port me"
Note:
See TracChangeset
for help on using the changeset viewer.