+++ /dev/null
-#******************************************************************************
-# @file Makefile.std
-#******************************************************************************
-AS=pdas --oformat coff
-CC=gccwin
-LD=pdld --no-insert-timestamp
-
-COPTS=-S -O2 -fno-common -ansi -I. -I../pdos/pdpclib -D__WIN32__ -D__NOBIVA__ -D__PDOS__
-COBJ=cache.obj common.obj list.obj report.obj
-
-all: clean mke2fs.exe e2cp.exe e2md.exe mke2nod.exe
-
-mke2fs.exe: mke2fs.obj $(COBJ)
- $(LD) -s -o mke2fs.exe ../pdos/pdpclib/w32start.obj mke2fs.obj $(COBJ) ../pdos/pdpclib/msvcrt.lib
-
-e2cp.exe: e2cp.obj $(COBJ)
- $(LD) -s -o e2cp.exe ../pdos/pdpclib/w32start.obj e2cp.obj $(COBJ) ../pdos/pdpclib/msvcrt.lib
-
-e2md.exe: e2md.obj $(COBJ)
- $(LD) -s -o e2md.exe ../pdos/pdpclib/w32start.obj e2md.obj $(COBJ) ../pdos/pdpclib/msvcrt.lib
-
-mke2nod.exe: mke2nod.obj $(COBJ)
- $(LD) -s -o mke2nod.exe ../pdos/pdpclib/w32start.obj mke2nod.obj $(COBJ) ../pdos/pdpclib/msvcrt.lib
-
-.c.obj:
- $(CC) $(COPTS) $<
- $(AS) -o $@ $*.s
- rm -f $*.s
-
-clean:
- rm -f *.obj
- rm -f mke2fs.exe
- rm -f e2cp.exe
- rm -f e2md.exe
- rm -f mke2nod.exe
}
-#ifndef __PDOS__
-# if defined (_WIN32)
-# include <windows.h>
-# include <winioctl.h>
-# elif defined (__GNUC__)
-# include <sys/ioctl.h>
-# include <termios.h>
-# include <unistd.h>
-# if defined (__CYGWIN__)
-# include <sys/socket.h>
-# endif
+#if defined (_WIN32)
+# include <windows.h>
+# include <winioctl.h>
+#elif defined (__GNUC__)
+# include <sys/ioctl.h>
+# include <termios.h>
+# include <unistd.h>
+# if defined (__CYGWIN__)
+# include <sys/socket.h>
# endif
/** Get a single character from the terminal. */
static char getch (void) {
-#if defined(_WIN32) && !defined (__PDOS__)
+#if defined(_WIN32)
KEY_EVENT_RECORD keyevent;
INPUT_RECORD irec;
}
-#else
-
- int key;
-
-#if defined (__PDOS__)
-
- setvbuf (stdin, NULL, _IONBF, 0);
-
- for (;;) {
-
#else
struct termios term;
- int nbbytes;
+ int nbbytes, key;
tcgetattr (0, &term);
}
-#if defined (__PDOS__)
- setvbuf (stdin, NULL, _IOLBF, 0);
-#else
-
term.c_lflag |= (ICANON | ECHO); /* turn on line buffering and echoing */
tcsetattr (0, TCSANOW, &term);
-
-#endif
switch (key) {
#endif
}
-#endif
static int check_overwrite (const char *fn) {
-#if defined (__PDOS__)
-
- report_at (NULL, 0, REPORT_WARNING, "overwriting %s", fn);
- return 1;
-
-#else
-
int ch;
printf ("File %s already exists.\n", fn);
return check_overwrite (fn);
-#endif
-
}
static void copy_file (struct filesystem *fs, FILE *fp, unsigned long parent_nod, char *target) {
unsigned long errors = 0;
-#ifndef __PDOS__
-#if defined (_WIN32)
+#if defined (unix) || defined (__unix) || defined (__unix__) || defined (__APPLE__)
+static void reset_console_color (void) {
+ fprintf (stderr, "\033[0m");
+}
+
+static void set_console_color (int color) {
+ fprintf (stderr, "\033[%dm", color);
+}
+#elif defined (_WIN32)
# include <windows.h>
static int OriginalConsoleColor = -1;
-#endif
static void reset_console_color (void) {
-#if defined (_WIN32)
-
HANDLE hStdError = GetStdHandle (STD_ERROR_HANDLE);
if (OriginalConsoleColor == -1) { return; }
SetConsoleTextAttribute (hStdError, OriginalConsoleColor);
OriginalConsoleColor = -1;
-#else
-
- fprintf (stderr, "\033[0m");
-
-#endif
-
}
static void set_console_color (int color) {
-#if defined (_WIN32)
-
HANDLE hStdError = GetStdHandle (STD_ERROR_HANDLE);
WORD wColor;
wColor = (OriginalConsoleColor & 0xF0) + (color & 0xF);
SetConsoleTextAttribute (hStdError, wColor);
-#else
-
- fprintf (stderr, "\033[%dm", color);
-
-#endif
-
}
#endif
if (type == REPORT_ERROR || type == REPORT_FATAL_ERROR) {
-#ifndef __PDOS__
+#if defined (unix) || defined (__unix) || defined (__unix__) || defined (__APPLE__) || defined (_WIN32)
set_console_color (COLOR_ERROR);
#endif
} else if (type == REPORT_INTERNAL_ERROR) {
-#ifndef __PDOS__
+#if defined (unix) || defined (__unix) || defined (__unix__) || defined (__APPLE__) || defined (_WIN32)
set_console_color (COLOR_INTERNAL_ERROR);
#endif
} else if (type == REPORT_WARNING) {
-#ifndef __PDOS__
+#if defined (unix) || defined (__unix) || defined (__unix__) || defined (__APPLE__) || defined (_WIN32)
set_console_color (COLOR_WARNING);
#endif
}
-#ifndef __PDOS__
+#if defined (unix) || defined (__unix) || defined (__unix__) || defined (__APPLE__) || defined (_WIN32)
reset_console_color ();
#endif