--- /dev/null
+#******************************************************************************
+# @file Makefile.zpg
+#******************************************************************************
+AS=as370
+CC=gcc370
+LD=pdld --oformat mainframe -e __crt0
+
+COPTS=-S -Os -fno-common -U__MVS__ -D__MF32__ -D__PDOSGEN__ \
+ -D__NOBIVA__ -D__PDOS__ -ansi \
+ -I . -I../pdos/pdpclib -I../pdos/src -I../pdos/generic
+COBJ=common.obj report.obj write7x.obj
+
+all: clean mkdosfs.exe mcopy.exe mmd.exe mls.exe
+
+mkdosfs.exe: lib.obj mkfs.obj $(COBJ)
+ $(LD) -s -o mkdosfs.exe ../pdos/pdpclib/pgastart.o lib.obj mkfs.obj $(COBJ)
+
+mcopy.exe: mcopy.obj $(COBJ)
+ $(LD) -s -o mcopy.exe ../pdos/pdpclib/pgastart.o mcopy.obj $(COBJ)
+
+mmd.exe: mmd.obj $(COBJ)
+ $(LD) -s -o mmd.exe ../pdos/pdpclib/pgastart.o mmd.obj $(COBJ)
+
+mls.exe: mls.obj $(COBJ)
+ $(LD) -s -o mls.exe ../pdos/pdpclib/pgastart.o mls.obj $(COBJ)
+
+.c.obj:
+ $(CC) $(COPTS) $<
+ $(AS) -o $@ $*.s
+ rm -f $*.s
+
+clean:
+ rm -f *.obj
+ rm -f mkdosfs.exe
+ rm -f mcopy.exe
+ rm -f mmd.exe
+ rm -f mls.exe
time_t create_time;
#endif
- struct tm *ctime = NULL;
+ struct tm *xctime = NULL;
#if defined (__GNUC__) && !defined (__PDOS__)
if (gettimeofday (&create_timeval, 0) == 0 && create_timeval.tv_sec != (time_t) -1) {
- ctime = localtime ((time_t *) &create_timeval.tv_sec);
+ xctime = localtime ((time_t *) &create_timeval.tv_sec);
}
#else
if (time (&create_time) != 0 && create_time != 0) {
- ctime = localtime (&create_time);
+ xctime = localtime (&create_time);
}
#endif
- if (ctime != NULL && ctime->tm_year >= 80 && ctime->tm_year <= 207) {
- return (unsigned short) (ctime->tm_mday + ((ctime->tm_mon + 1) << 5) + ((ctime->tm_year - 80) << 9));
+ if (xctime != NULL && xctime->tm_year >= 80 && xctime->tm_year <= 207) {
+ return (unsigned short) (xctime->tm_mday + ((xctime->tm_mon + 1) << 5) + ((xctime->tm_year - 80) << 9));
}
return 1 + (1 << 5);
time_t create_time;
#endif
- struct tm *ctime = NULL;
+ struct tm *xctime = NULL;
#if defined (__GNUC__) && !defined (__PDOS__)
if (gettimeofday (&create_timeval, 0) == 0 && create_timeval.tv_sec != (time_t) -1) {
- ctime = localtime ((time_t *) &create_timeval.tv_sec);
+ xctime = localtime ((time_t *) &create_timeval.tv_sec);
}
#else
if (time (&create_time) != 0 && create_time != 0) {
- ctime = localtime (&create_time);
+ xctime = localtime (&create_time);
}
#endif
- if (ctime != NULL && ctime->tm_year >= 80 && ctime->tm_year <= 207) {
- return (unsigned short) ((ctime->tm_sec >> 1) + (ctime->tm_min << 5) + (ctime->tm_hour << 11));
+ if (xctime != NULL && xctime->tm_year >= 80 && xctime->tm_year <= 207) {
+ return (unsigned short) ((xctime->tm_sec >> 1) + (xctime->tm_min << 5) + (xctime->tm_hour << 11));
}
return 0;
struct msdos_dirent de;
unsigned short date;
- unsigned short time;
+ unsigned short xtime;
unsigned int tempclust;
}
date = generate_datestamp ();
- time = generate_timestamp ();
+ xtime = generate_timestamp ();
memset (&de, 0, sizeof (de));
memcpy (de.name, filename, 11);
de.attr = ATTR_ARCHIVE;
- write721_to_byte_array (de.ctime, time);
+ write721_to_byte_array (de.xctime, xtime);
write721_to_byte_array (de.cdate, date);
write721_to_byte_array (de.adate, date);
- write721_to_byte_array (de.time, time);
+ write721_to_byte_array (de.xtime, xtime);
write721_to_byte_array (de.date, date);
fi->pointer = 0;
}
date = generate_datestamp ();
- time = generate_timestamp ();
+ xtime = generate_timestamp ();
memset (&de, 0, sizeof (de));
memcpy (de.name, filename, 11);
de.attr = ATTR_ARCHIVE;
- write721_to_byte_array (de.ctime, time);
+ write721_to_byte_array (de.xctime, xtime);
write721_to_byte_array (de.cdate, date);
write721_to_byte_array (de.adate, date);
- write721_to_byte_array (de.time, time);
+ write721_to_byte_array (de.xtime, xtime);
write721_to_byte_array (de.date, date);
fi->pointer = 0;
static void add_volume_label (void) {
struct msdos_dirent *de;
- unsigned short date, time;
+ unsigned short date, xtime;
unsigned char *scratch;
long offset = 0;
memset (de, 0, sizeof (*de));
date = generate_datestamp ();
- time = generate_timestamp ();
+ xtime = generate_timestamp ();
memcpy (de->name, state->label, 11);
de->attr = ATTR_VOLUME_ID;
- write721_to_byte_array (de->ctime, time);
+ write721_to_byte_array (de->xctime, xtime);
write721_to_byte_array (de->cdate, date);
write721_to_byte_array (de->adate, date);
- write721_to_byte_array (de->time, time);
+ write721_to_byte_array (de->xtime, xtime);
write721_to_byte_array (de->date, date);
if (seekto (offset * 512) || fwrite (scratch, 512, 1, ofp) != 1) {
struct msdos_dirent de;
unsigned short date;
- unsigned short time;
+ unsigned short xtime;
unsigned int cluster, i;
unsigned int dir_sector;
}
date = generate_datestamp ();
- time = generate_timestamp ();
+ xtime = generate_timestamp ();
memset (&de, 0, sizeof (de));
memcpy (de.name, filename, 11);
de.attr = ATTR_DIR;
- write721_to_byte_array (de.ctime, time);
+ write721_to_byte_array (de.xctime, xtime);
write721_to_byte_array (de.cdate, date);
write721_to_byte_array (de.adate, date);
- write721_to_byte_array (de.time, time);
+ write721_to_byte_array (de.xtime, xtime);
write721_to_byte_array (de.date, date);
if (di.current_cluster == 0) {
unsigned char attr;
unsigned char lcase;
unsigned char ctime_cs;
- unsigned char ctime[2];
+ unsigned char xctime[2];
unsigned char cdate[2];
unsigned char adate[2];
unsigned char starthi[2];
- unsigned char time[2];
+ unsigned char xtime[2];
unsigned char date[2];
unsigned char startlo[2];
unsigned char size[4];