mirror of
https://github.com/reactos/reactos.git
synced 2024-12-26 17:14:41 +00:00
Update to build cmd separately.
svn path=/trunk/; revision=445
This commit is contained in:
parent
6a7adfd71f
commit
ffbc9d9c03
7 changed files with 30 additions and 43 deletions
|
@ -360,19 +360,14 @@ VOID ReadCommand (LPTSTR str, INT maxlen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
#ifdef __REACTOS__
|
|
||||||
ch = ir.Event.KeyEvent.AsciiChar;
|
|
||||||
if ((ch >= 32) && (charcount != (maxlen - 2)))
|
|
||||||
{
|
|
||||||
#else
|
|
||||||
#ifdef _UNICODE
|
#ifdef _UNICODE
|
||||||
ch = ir.Event.KeyEvent.uChar.UnicodeChar;
|
ch = ir.Event.KeyEvent.uChar.UnicodeChar;
|
||||||
|
if ((ch >= 32 && ch <= 255) && (charcount != (maxlen - 2)))
|
||||||
#else
|
#else
|
||||||
ch = ir.Event.KeyEvent.uChar.AsciiChar;
|
ch = ir.Event.KeyEvent.uChar.AsciiChar;
|
||||||
|
if (ch >= 32 && (charcount != (maxlen - 2)))
|
||||||
#endif /* _UNICODE */
|
#endif /* _UNICODE */
|
||||||
if ((ch >= 32 && ch <= 255) && (charcount != (maxlen - 2)))
|
|
||||||
{
|
{
|
||||||
#endif /* __REACTOS__ */
|
|
||||||
/* insert character into string... */
|
/* insert character into string... */
|
||||||
if (bInsert && current != charcount)
|
if (bInsert && current != charcount)
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,9 +14,17 @@
|
||||||
#ifndef _CONFIG_H_INCLUDED_
|
#ifndef _CONFIG_H_INCLUDED_
|
||||||
#define _CONFIG_H_INCLUDED_
|
#define _CONFIG_H_INCLUDED_
|
||||||
|
|
||||||
#ifndef __REACTOS__
|
//#ifndef __REACTOS__
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#endif /* __REACTOS__ */
|
//#endif /* __REACTOS__ */
|
||||||
|
|
||||||
|
|
||||||
|
//#ifdef UNICODE
|
||||||
|
//#define _T(x) L##x
|
||||||
|
//#else
|
||||||
|
//#define _T(x) x
|
||||||
|
//#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* JPP 20 Jul 1998 - define DEBUG to add debugging code */
|
/* JPP 20 Jul 1998 - define DEBUG to add debugging code */
|
||||||
|
|
|
@ -810,8 +810,8 @@ DirList (LPTSTR szPath, LPTSTR szFilespec, LPINT pLine, DWORD dwFlags)
|
||||||
count = 0;
|
count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uliSize.LowPart = file.nFileSizeLow;
|
uliSize.u.LowPart = file.nFileSizeLow;
|
||||||
uliSize.HighPart = file.nFileSizeHigh;
|
uliSize.u.HighPart = file.nFileSizeHigh;
|
||||||
bytecount.QuadPart += uliSize.QuadPart;
|
bytecount.QuadPart += uliSize.QuadPart;
|
||||||
}
|
}
|
||||||
else if (dwFlags & DIR_BARE)
|
else if (dwFlags & DIR_BARE)
|
||||||
|
@ -841,8 +841,8 @@ DirList (LPTSTR szPath, LPTSTR szFilespec, LPINT pLine, DWORD dwFlags)
|
||||||
if (IncLine (pLine, dwFlags))
|
if (IncLine (pLine, dwFlags))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
uliSize.LowPart = file.nFileSizeLow;
|
uliSize.u.LowPart = file.nFileSizeLow;
|
||||||
uliSize.HighPart = file.nFileSizeHigh;
|
uliSize.u.HighPart = file.nFileSizeHigh;
|
||||||
bytecount.QuadPart += uliSize.QuadPart;
|
bytecount.QuadPart += uliSize.QuadPart;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -866,14 +866,14 @@ DirList (LPTSTR szPath, LPTSTR szFilespec, LPINT pLine, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
ULARGE_INTEGER uliSize;
|
ULARGE_INTEGER uliSize;
|
||||||
|
|
||||||
uliSize.LowPart = file.nFileSizeLow;
|
uliSize.u.LowPart = file.nFileSizeLow;
|
||||||
uliSize.HighPart = file.nFileSizeHigh;
|
uliSize.u.HighPart = file.nFileSizeHigh;
|
||||||
|
|
||||||
ConvertULargeInteger (uliSize, buffer, sizeof(buffer));
|
ConvertULargeInteger (uliSize, buffer, sizeof(buffer));
|
||||||
ConOutPrintf (_T(" %20s"), buffer);
|
ConOutPrintf (_T(" %20s"), buffer);
|
||||||
|
|
||||||
bytecount.QuadPart += uliSize.QuadPart;
|
bytecount.QuadPart += uliSize.QuadPart;
|
||||||
filecount++;
|
filecount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* print long filename */
|
/* print long filename */
|
||||||
|
@ -918,9 +918,9 @@ DirList (LPTSTR szPath, LPTSTR szFilespec, LPINT pLine, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
ULARGE_INTEGER uliSize;
|
ULARGE_INTEGER uliSize;
|
||||||
|
|
||||||
uliSize.LowPart = file.nFileSizeLow;
|
uliSize.u.LowPart = file.nFileSizeLow;
|
||||||
uliSize.HighPart = file.nFileSizeHigh;
|
uliSize.u.HighPart = file.nFileSizeHigh;
|
||||||
ConvertULargeInteger (uliSize, buffer, sizeof(buffer));
|
ConvertULargeInteger (uliSize, buffer, sizeof(buffer));
|
||||||
ConOutPrintf (_T(" %10s "), buffer);
|
ConOutPrintf (_T(" %10s "), buffer);
|
||||||
bytecount.QuadPart += uliSize.QuadPart;
|
bytecount.QuadPart += uliSize.QuadPart;
|
||||||
filecount++;
|
filecount++;
|
||||||
|
@ -1058,7 +1058,7 @@ DirRecurse (LPTSTR szPath, LPTSTR szSpec, LPINT pLine, DWORD dwFlags)
|
||||||
dwFlags &= ~DIR_RECURSE;
|
dwFlags &= ~DIR_RECURSE;
|
||||||
|
|
||||||
if (PrintSummary (szPath, recurse_file_cnt,
|
if (PrintSummary (szPath, recurse_file_cnt,
|
||||||
recurse_dir_cnt, recurse_bytes, pLine, dwFlags))
|
recurse_dir_cnt, recurse_bytes, pLine, dwFlags))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if ((dwFlags & DIR_BARE) == 0)
|
if ((dwFlags & DIR_BARE) == 0)
|
||||||
|
|
|
@ -223,7 +223,7 @@ BOOL ShowCompletionMatches (LPTSTR str, INT charcount)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (file.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
if (file.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||||
_stprintf (fname, _T("[%s]"), file.cFileName);
|
_stprintf (fname, _T("[%s]"), file.cFileName);
|
||||||
else
|
else
|
||||||
_tcscpy (fname, file.cFileName);
|
_tcscpy (fname, file.cFileName);
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "cmd.h"
|
||||||
|
|
||||||
#define MAXLINES 128
|
#define MAXLINES 128
|
||||||
|
|
||||||
|
|
|
@ -2,21 +2,15 @@
|
||||||
# ReactOS makefile for CMD
|
# ReactOS makefile for CMD
|
||||||
#
|
#
|
||||||
|
|
||||||
# target: raw binary (does not work right now)
|
|
||||||
#all: cmd.bin
|
|
||||||
|
|
||||||
# target: executable (not tested/experimental)
|
|
||||||
all: cmd.exe
|
all: cmd.exe
|
||||||
|
|
||||||
OBJECTS = ../common/crt0.o cmd.o attrib.o alias.o batch.o beep.o call.o \
|
OBJECTS = cmd.o attrib.o alias.o batch.o beep.o call.o \
|
||||||
chcp.o cls.o cmdinput.o cmdtable.o color.o console.o copy.o date.o \
|
chcp.o cls.o cmdinput.o cmdtable.o color.o console.o copy.o date.o \
|
||||||
del.o dir.o dirstack.o echo.o error.o filecomp.o for.o goto.o \
|
del.o dir.o dirstack.o echo.o error.o filecomp.o for.o goto.o \
|
||||||
history.o if.o internal.o label.o locale.o misc.o move.o path.o \
|
history.o if.o internal.o label.o locale.o misc.o move.o path.o \
|
||||||
pause.o prompt.o redir.o ren.o ros.o set.o shift.o time.o title.o type.o \
|
pause.o prompt.o redir.o ren.o set.o shift.o time.o title.o type.o \
|
||||||
ver.o verify.o vol.o where.o
|
ver.o verify.o vol.o where.o
|
||||||
|
|
||||||
LIBS= ../../lib/kernel32/kernel32.a ../../lib/ntdll/ntdll.a
|
|
||||||
|
|
||||||
CLEAN_FILES = *.o cmd.exe cmd.sym
|
CLEAN_FILES = *.o cmd.exe cmd.sym
|
||||||
|
|
||||||
clean: $(CLEAN_FILES:%=%_clean)
|
clean: $(CLEAN_FILES:%=%_clean)
|
||||||
|
@ -26,15 +20,8 @@ $(CLEAN_FILES:%=%_clean): %_clean:
|
||||||
|
|
||||||
.phony: clean $(CLEAN_FILES:%=%_clean)
|
.phony: clean $(CLEAN_FILES:%=%_clean)
|
||||||
|
|
||||||
cmd.bin: $(OBJECTS)
|
cmd.exe: $(OBJECTS)
|
||||||
$(LD) -Ttext 0x10000 $(OBJECTS) $(LIBS) -o cmd.exe
|
$(CC) $(OBJECTS) -lkernel32 -lcrtdll -o cmd.exe
|
||||||
$(OBJCOPY) -O binary cmd.exe cmd.bin
|
|
||||||
|
|
||||||
cmd.exe: $(OBJECTS) $(LIBS)
|
|
||||||
$(CC) -specs=../../specs $(OBJECTS) $(LIBS) -lgcc -o cmd.exe
|
|
||||||
$(NM) --numeric-sort cmd.exe > cmd.sym
|
$(NM) --numeric-sort cmd.exe > cmd.sym
|
||||||
|
|
||||||
include ../../rules.mak
|
include ../rules.mak
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -62,15 +62,11 @@ TCHAR cgetchar (VOID)
|
||||||
}
|
}
|
||||||
while (TRUE);
|
while (TRUE);
|
||||||
|
|
||||||
#ifdef __REACTOS__
|
|
||||||
return irBuffer.Event.KeyEvent.AsciiChar;
|
|
||||||
#else
|
|
||||||
#ifndef _UNICODE
|
#ifndef _UNICODE
|
||||||
return irBuffer.Event.KeyEvent.uChar.AsciiChar;
|
return irBuffer.Event.KeyEvent.uChar.AsciiChar;
|
||||||
#else
|
#else
|
||||||
return irBuffer.Event.KeyEvent.uChar.UnicodeChar;
|
return irBuffer.Event.KeyEvent.uChar.UnicodeChar;
|
||||||
#endif /* _UNICODE */
|
#endif /* _UNICODE */
|
||||||
#endif /* __REACTOS__ */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue