summaryrefslogtreecommitdiff
path: root/Makefile.direct
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2017-03-23 01:41:25 +0300
committerIvan Maidanski <ivmai@mail.ru>2017-03-23 03:03:54 +0300
commit02b8b80e516c27bd2a5cd8d3fde79791d3b1fb28 (patch)
tree435ce4a629993f67729a4d02c4d6b7da49faba37 /Makefile.direct
parent645f4f3f1ec0ef1deec789fb5728e59c8c97e45b (diff)
downloadbdwgc-02b8b80e516c27bd2a5cd8d3fde79791d3b1fb28.tar.gz
Remove EMX_MAKEFILE (add EMX support to Makefile.direct)
* EMX_MAKEFILE: Remove. * Makefile.am (EXTRA_DIST): Remove EMX_MAKEFILE entity. * Makefile.direct (OTHER_MAKEFILES): Likewise. * Makefile.direct (CC, RANLIB): Add comment for EMX target. * Makefile.direct (EXEEXT): New variable (empty by default). * Makefile.direct (UTILS, all, cords, test_cpp, check-cpp, c++-t, dyn_test, cord/cordtest, cord/de, if_mach, threadlibs, if_not_there, gctest, setjmp_test, check): Add $(EXEEXT) suffix to if_mach, if_not_there, threadlibs, gctest, cord/cordtest, test_cpp, cord/de, setjmp_test.
Diffstat (limited to 'Makefile.direct')
-rw-r--r--Makefile.direct64
1 files changed, 37 insertions, 27 deletions
diff --git a/Makefile.direct b/Makefile.direct
index 43d08d3a..93fd1a71 100644
--- a/Makefile.direct
+++ b/Makefile.direct
@@ -22,6 +22,7 @@ AS_ABI_FLAG=$(ABI_FLAG)
# executables.
CC=cc $(ABI_FLAG)
+# Compiler executable name. For EMX, replace to "gcc".
CXX=g++ $(ABI_FLAG)
# Needed only for "make c++", which adds the c++ interface.
@@ -76,7 +77,9 @@ HOSTCFLAGS=$(CFLAGS)
CXXFLAGS= $(CFLAGS)
AR= ar
+
RANLIB= ranlib
+# For EMX, replace "ranlib" with "ar s".
OBJS= alloc.o reclaim.o allchblk.o misc.o mach_dep.o os_dep.o mark_rts.o \
@@ -143,7 +146,7 @@ GNU_BUILD_FILES= configure.ac Makefile.am configure install-sh Makefile.in \
bdw-gc.pc.in compile
OTHER_MAKEFILES= OS2_MAKEFILE NT_MAKEFILE gc.mak \
- BCC_MAKEFILE EMX_MAKEFILE WCC_MAKEFILE PCR-Makefile SMakefile.amiga \
+ BCC_MAKEFILE WCC_MAKEFILE PCR-Makefile SMakefile.amiga \
digimars.mak Makefile.direct NT_STATIC_THREADS_MAKEFILE \
NT_X64_STATIC_THREADS_MAKEFILE NT_X64_THREADS_MAKEFILE
@@ -159,7 +162,10 @@ OTHER_FILES= tools/setjmp_t.c tools/callprocs.sh extra/MacOS.c \
CORD_INCLUDE_FILES= $(srcdir)/include/gc.h $(srcdir)/include/cord.h \
$(srcdir)/include/ec.h $(srcdir)/include/cord_pos.h
-UTILS= if_mach if_not_there threadlibs
+# Executable file name extension. For EMX, specify ".exe".
+EXEEXT=
+
+UTILS= if_mach$(EXEEXT) if_not_there$(EXEEXT) threadlibs$(EXEEXT)
# Libraries needed for curses applications. Only needed for de.
# It might also require -ltermlib on some targets.
@@ -176,7 +182,7 @@ SPECIALCFLAGS= -I$(srcdir)/include -I$(AO_SRC_DIR)/src
# not time-critical anyway.
# Set SPECIALCFLAGS to -q nodirect_code on Encore.
-all: base_lib gctest
+all: base_lib gctest$(EXEEXT)
atomic_ops.o: $(AO_SRC_DIR)/src/atomic_ops.c
$(CC) $(CFLAGS) -c -o $@ $<
@@ -243,7 +249,7 @@ base_lib gc.a: $(OBJS) dyn_load.o $(UTILS)
# Ignore ranlib failure; that usually means it doesn't exist, and
# isn't needed.
-cords: $(CORD_OBJS) cord/cordtest $(UTILS) base_lib
+cords: $(CORD_OBJS) cord/cordtest$(EXEEXT) $(UTILS) base_lib
rm -f dont_ar_3
./if_mach SPARC SOLARIS touch dont_ar_3
./if_mach SPARC SOLARIS $(AR) rus gc.a $(CORD_OBJS)
@@ -255,16 +261,16 @@ cords: $(CORD_OBJS) cord/cordtest $(UTILS) base_lib
gc_cpp.o: $(srcdir)/gc_cpp.cc $(srcdir)/include/gc_cpp.h $(srcdir)/include/gc.h
$(CXX) -c $(CXXFLAGS) $(srcdir)/gc_cpp.cc
-test_cpp: $(srcdir)/tests/test_cpp.cc $(srcdir)/include/gc_cpp.h $(srcdir)/include/gc.h \
- gc_cpp.o base_lib $(UTILS)
- rm -f test_cpp
+test_cpp$(EXEEXT): $(srcdir)/tests/test_cpp.cc $(srcdir)/include/gc_cpp.h \
+ $(srcdir)/include/gc.h gc_cpp.o base_lib $(UTILS)
+ rm -f test_cpp$(EXEEXT)
./if_mach HP_PA HPUX $(CXX) $(CXXFLAGS) -o test_cpp $(srcdir)/tests/test_cpp.cc gc_cpp.o gc.a -ldld `./threadlibs`
- ./if_not_there test_cpp $(CXX) $(CXXFLAGS) -o test_cpp $(srcdir)/tests/test_cpp.cc gc_cpp.o gc.a `./threadlibs`
+ ./if_not_there test_cpp$(EXEEXT) $(CXX) $(CXXFLAGS) -o test_cpp$(EXEEXT) $(srcdir)/tests/test_cpp.cc gc_cpp.o gc.a `./threadlibs`
-check-cpp: test_cpp
+check-cpp: test_cpp$(EXEEXT)
./test_cpp
-c++-t: c++ test_cpp
+c++-t: c++ test_cpp$(EXEEXT)
./test_cpp 1
c++-nt: c++
@@ -305,7 +311,7 @@ liblinuxgc.so: $(OBJS) dyn_load.o
# Build gctest with dynamic library
dyn_test:
- $(CC) $(CFLAGS) -o gctest tests/test.c libgc.so `./threadlibs`
+ $(CC) $(CFLAGS) -o gctest$(EXEEXT) tests/test.c libgc.so `./threadlibs`
./gctest
# Alternative Linux rule. This is preferable, but is likely to break the
@@ -365,12 +371,13 @@ cord/cordprnt.o: cord $(srcdir)/cord/cordprnt.c $(CORD_INCLUDE_FILES)
$(CC) $(CFLAGS) -c -I$(srcdir) $(srcdir)/cord/cordprnt.c
mv cordprnt.o cord/cordprnt.o
-cord/cordtest: $(srcdir)/cord/tests/cordtest.c $(CORD_OBJS) base_lib $(UTILS)
- rm -f cord/cordtest
+cord/cordtest$(EXEEXT): $(srcdir)/cord/tests/cordtest.c $(CORD_OBJS) \
+ base_lib $(UTILS)
+ rm -f cord/cordtest$(EXEEXT)
./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o cord/cordtest $(srcdir)/cord/tests/cordtest.c $(CORD_OBJS) gc.a -lucb
./if_mach HP_PA HPUX $(CC) $(CFLAGS) -o cord/cordtest $(srcdir)/cord/tests/cordtest.c $(CORD_OBJS) gc.a -ldld `./threadlibs`
./if_mach M68K AMIGA $(CC) $(CFLAGS) -UGC_AMIGA_MAKINGLIB -o cord/cordtest $(srcdir)/cord/tests/cordtest.c $(CORD_OBJS) gc.a `./threadlibs`
- ./if_not_there cord/cordtest $(CC) $(CFLAGS) -o cord/cordtest $(srcdir)/cord/tests/cordtest.c $(CORD_OBJS) gc.a `./threadlibs`
+ ./if_not_there cord/cordtest$(EXEEXT) $(CC) $(CFLAGS) -o cord/cordtest$(EXEEXT) $(srcdir)/cord/tests/cordtest.c $(CORD_OBJS) gc.a `./threadlibs`
cord/de: $(srcdir)/cord/tests/de.c cord/cordbscs.o cord/cordxtra.o base_lib \
$(UTILS)
@@ -383,16 +390,18 @@ cord/de: $(srcdir)/cord/tests/de.c cord/cordbscs.o cord/cordxtra.o base_lib \
./if_mach ALPHA LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/tests/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses `./threadlibs`
./if_mach IA64 LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/tests/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses `./threadlibs`
./if_mach M68K AMIGA $(CC) $(CFLAGS) -UGC_AMIGA_MAKINGLIB -o cord/de $(srcdir)/cord/tests/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses
- ./if_not_there cord/de $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/tests/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(CURSES) `./threadlibs`
+ ./if_not_there cord/de$(EXEEXT) $(CC) $(CFLAGS) -o cord/de$(EXEEXT) $(srcdir)/cord/tests/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(CURSES) `./threadlibs`
-if_mach: $(srcdir)/tools/if_mach.c $(srcdir)/include/private/gcconfig.h
- $(HOSTCC) $(HOSTCFLAGS) -o if_mach $(srcdir)/tools/if_mach.c
+if_mach$(EXEEXT): $(srcdir)/tools/if_mach.c \
+ $(srcdir)/include/private/gcconfig.h
+ $(HOSTCC) $(HOSTCFLAGS) -o if_mach$(EXEEXT) $(srcdir)/tools/if_mach.c
-threadlibs: $(srcdir)/tools/threadlibs.c $(srcdir)/include/private/gcconfig.h
- $(HOSTCC) $(HOSTCFLAGS) -o threadlibs $(srcdir)/tools/threadlibs.c
+threadlibs$(EXEEXT): $(srcdir)/tools/threadlibs.c \
+ $(srcdir)/include/private/gcconfig.h
+ $(HOSTCC) $(HOSTCFLAGS) -o threadlibs$(EXEEXT) $(srcdir)/tools/threadlibs.c
-if_not_there: $(srcdir)/tools/if_not_there.c
- $(HOSTCC) $(HOSTCFLAGS) -o if_not_there $(srcdir)/tools/if_not_there.c
+if_not_there$(EXEEXT): $(srcdir)/tools/if_not_there.c
+ $(HOSTCC) $(HOSTCFLAGS) -o if_not_there$(EXEEXT) $(srcdir)/tools/if_not_there.c
clean:
rm -f gc.a *.i *.o *.exe tests/*.o gctest gctest_dyn_link test_cpp \
@@ -400,20 +409,21 @@ clean:
base_lib c++ threadlibs $(CORD_OBJS) cord/cordtest cord/de
-rm -f *~
-gctest: tests/test.o base_lib $(UTILS)
- rm -f gctest
+gctest$(EXEEXT): tests/test.o base_lib $(UTILS)
+ rm -f gctest$(EXEEXT)
./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o gctest tests/test.o gc.a -lucb
./if_mach HP_PA HPUX $(CC) $(CFLAGS) -o gctest tests/test.o gc.a -ldld `./threadlibs`
./if_mach M68K AMIGA $(CC) $(CFLAGS) -UGC_AMIGA_MAKINGLIB -o gctest tests/test.o gc.a `./threadlibs`
- ./if_not_there gctest $(CC) $(CFLAGS) -o gctest tests/test.o gc.a `./threadlibs`
+ ./if_not_there gctest$(EXEEXT) $(CC) $(CFLAGS) -o gctest$(EXEEXT) tests/test.o gc.a `./threadlibs`
# If an optimized setjmp_test generates a segmentation fault,
# odds are your compiler is broken. Gctest may still work.
# Try compiling setjmp_t.c unoptimized.
-setjmp_test: $(srcdir)/tools/setjmp_t.c $(srcdir)/include/gc.h $(UTILS)
- $(CC) $(CFLAGS) -o setjmp_test $(srcdir)/tools/setjmp_t.c
+setjmp_test$(EXEEXT): $(srcdir)/tools/setjmp_t.c $(srcdir)/include/gc.h \
+ $(UTILS)
+ $(CC) $(CFLAGS) -o setjmp_test$(EXEEXT) $(srcdir)/tools/setjmp_t.c
-check: cord/cordtest gctest setjmp_test
+check: cord/cordtest$(EXEEXT) gctest$(EXEEXT) setjmp_test$(EXEEXT)
./setjmp_test
./gctest
cord/cordtest