Added another makefile
authorRobert Pengelly <robertapengelly@hotmail.com>
Sat, 30 Aug 2025 23:01:40 +0000 (00:01 +0100)
committerRobert Pengelly <robertapengelly@hotmail.com>
Sat, 30 Aug 2025 23:01:40 +0000 (00:01 +0100)
Makefile.std [new file with mode: 0644]
e2cp.c

diff --git a/Makefile.std b/Makefile.std
new file mode 100644 (file)
index 0000000..2bdc10c
--- /dev/null
@@ -0,0 +1,31 @@
+#******************************************************************************
+# @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
+
+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
+
+.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
diff --git a/e2cp.c b/e2cp.c
index 635aadcf953f1363184a3aa92c5961b96ee69d3a..3a5ebafa024f0a2ec1b27e708a53dd62a070f23f 100644 (file)
--- a/e2cp.c
+++ b/e2cp.c
@@ -342,11 +342,11 @@ unsigned long mkfile_fs (struct filesystem *fs, unsigned long parent_nod, const
 
     unsigned long nod;
     
+    struct inode_pos ipos;
     struct nod_info *ni;
     struct inode *node;
     
     signed long actual_size;
-    struct inode_pos ipos;
     
     nod = mknod_fs (fs, parent_nod, name, mode_con (mode), uid, gid, ctime, mtime);
     node = get_nod (fs, nod, &ni);
@@ -365,12 +365,15 @@ unsigned long mkfile_fs (struct filesystem *fs, unsigned long parent_nod, const
     
     }
     
+#if     ULONG_MAX > 4294967295UL
     write_to_byte_array (node->i_dir_acl, actual_size >> 32, 4);
+#endif
+    
     write_to_byte_array (node->i_size, actual_size, 4);
     
     inode_pos_finish (&ipos);
-    
     put_nod (ni);
+    
     return nod;
 
 }
@@ -461,7 +464,7 @@ int main (int argc, char **argv) {
     
     atexit (cleanup);
     
-    mode = xstrdup ("---666");
+    mode = xstrdup ("---755");
     parse_args (argc, argv, 1);
     
     if (!outfile) {