From 2c06abe71ada6d58af3314693e805df210b034c4 Mon Sep 17 00:00:00 2001 From: Mackenzie Straight Date: Sun, 1 May 2005 23:40:44 +0000 Subject: [PATCH] Merge win32 and unix makefiles (MSYS is now required to build on Windows) --- Makefile | 26 +++++++++++++++---- Makefile.win32 | 63 --------------------------------------------- native/win32/file.c | 2 +- 3 files changed, 22 insertions(+), 69 deletions(-) delete mode 100644 Makefile.win32 diff --git a/Makefile b/Makefile index 3da0b99b7b..e315c7dd7c 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,18 @@ STRIP = strip UNIX_OBJS = native/unix/file.o native/unix/signal.o \ native/unix/ffi.o native/unix/run.o -OBJS = $(UNIX_OBJS) native/arithmetic.o native/array.o native/bignum.o \ +WIN32_OBJS = native/win32/ffi.o native/win32/file.o \ + native/win32/misc.o \ + native/win32/run.o + +ifdef WIN32 + PLAF_OBJS = $(WIN32_OBJS) + PLAF_SUFFIX = .exe +else + PLAF_OBJS = $(UNIX_OBJS) +endif + +OBJS = $(PLAF_OBJS) native/arithmetic.o native/array.o native/bignum.o \ native/s48_bignum.o \ native/complex.o native/cons.o native/error.o \ native/factor.o native/fixnum.o \ @@ -45,7 +56,7 @@ default: bsd: $(MAKE) f \ CFLAGS="$(DEFAULT_CFLAGS) -export-dynamic -pthread" \ - LIBS="$(DEFAULT_LIBS)" + LIBS="$(DEFAULT_LIBS)" $(STRIP) f bsd-nopthread: @@ -62,17 +73,22 @@ macosx: linux: $(MAKE) f \ CFLAGS="$(DEFAULT_CFLAGS) -export-dynamic" \ - LIBS="$(DEFAULT_LIBS) -ldl" + LIBS="$(DEFAULT_LIBS) -ldl" $(STRIP) f linux-ppc: $(MAKE) f \ CFLAGS="$(DEFAULT_CFLAGS) -export-dynamic -mregnames" \ - LIBS="$(DEFAULT_LIBS) -ldl" + LIBS="$(DEFAULT_LIBS) -ldl" $(STRIP) f +windows: + $(MAKE) f \ + CFLAGS="$(DEFAULT_CFLAGS) -DFFI -DWIN32" \ + LIBS="$(DEFAULT_LIBS)" WIN32=y + f: $(OBJS) - $(CC) $(LIBS) $(CFLAGS) -o $@ $(OBJS) + $(CC) $(LIBS) $(CFLAGS) -o $@$(PLAF_SUFFIX) $(OBJS) clean: rm -f $(OBJS) diff --git a/Makefile.win32 b/Makefile.win32 deleted file mode 100644 index 83723b15fc..0000000000 --- a/Makefile.win32 +++ /dev/null @@ -1,63 +0,0 @@ -# :mode=makefile: - -CC = gcc -DEFAULT_CFLAGS = -Wall -O3 -fomit-frame-pointer $(SITE_CFLAGS) -DEFAULT_LIBS = -lm - -STRIP = strip - -WIN32_OBJS = native\win32\ffi.o native\win32\file.o \ - native\win32\misc.o \ - native\win32\run.o - -OBJS = $(WIN32_OBJS) native\arithmetic.o native\array.o native\bignum.o \ - native\s48_bignum.o \ - native\complex.o native\cons.o native\error.o \ - native\factor.o native\fixnum.o \ - native\float.o native\gc.o \ - native\image.o native\memory.o \ - native\misc.o native\primitives.o \ - native\ratio.o native\relocate.o \ - native\run.o \ - native\sbuf.o native\stack.o \ - native\string.o native\types.o native\vector.o \ - native\word.o native\compiler.o \ - native\alien.o native\dll.o \ - native\boolean.o \ - native\debug.o \ - native\hashtable.o \ - native\icache.o \ - native\io.o - -default: - @echo "Run 'make' with one of the following parameters:" - @echo "" - @echo "windows" - @echo "" - @echo "Also, you might want to set the SITE_CFLAGS environment" - @echo "variable to enable some CPU-specific optimizations; this" - @echo "can make a huge difference. Eg:" - @echo "" - @echo "export SITE_CFLAGS=\"-march=pentium4 -ffast-math\"" - -windows: - $(MAKE) -f Makefile.win32 f \ - CFLAGS="$(DEFAULT_CFLAGS) -DFFI -DWIN32" \ - LIBS="$(DEFAULT_LIBS)" - -f: $(OBJS) - $(CC) $(LIBS) $(CFLAGS) -o $@ $(OBJS) - $(STRIP) $@ - -clean: - del $(OBJS) - -.c.o: - $(CC) -c $(CFLAGS) -o $@ $< - -.S.o: - $(CC) -c $(CFLAGS) -o $@ $< - -native\icache.o: native\icache.s - $(CC) -c $(CFLAGS) -o $@ native\icache.S - diff --git a/native/win32/file.c b/native/win32/file.c index 2f392eb16d..e96a3af343 100644 --- a/native/win32/file.c +++ b/native/win32/file.c @@ -57,7 +57,7 @@ void primitive_cwd(void) maybe_garbage_collection(); if(!GetCurrentDirectory(MAX_PATH, buf)) - io_error(__FUNCTION__); + io_error(); box_c_string(buf); }