Skip to content

Commit 22fee4a

Browse files
committed
Fix EMX_MAKEFILE (adjust path to header files, add -I option)
* EMX_MAKEFILE: Remove comment about renaming to Makefile. * EMX_MAKEFILE (CFLAGS, SPECIALCFLAGS): Add "-I include" option. * EMX_MAKEFILE (CXXFLAGS): New variable (set to CFLAGS value). * EMX_MAKEFILE (CORD_INCLUDE_FILES, test.o, setjmp_test.exe): Adjust path to gc.h. * EMX_MAKEFILE (SHELL): Remove special variable (not needed for EMX). * EMX_MAKEFILE (test.o): Adjust path to dependencies (gc_priv.h, gc_hdrs.h, gcconfig.h, gc_typed.h). * EMX_MAKEFILE (gc_cpp.o, c++): Adjust path to gc_cpp.h. * EMX_MAKEFILE (gc_cpp.o): Use CXXFLAGS value instead of "-O". * EMX_MAKEFILE (c++): Do not copy gc_cpp.h to "include" folder.
1 parent 6162581 commit 22fee4a

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

EMX_MAKEFILE

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
# You need GNU Make 3.71, gcc 2.5.7, emx 0.8h and GNU fileutils 3.9
55
# or similar tools. C++ interface and de.exe weren't tested.
66
#
7-
# Rename this file "Makefile".
8-
#
97

108
# Primary targets:
119
# gc.a - builds basic library
@@ -18,10 +16,11 @@ CC= gcc
1816
CXX=g++
1917
# Needed only for "make c++", which adds the c++ interface
2018

21-
CFLAGS= -O -DALL_INTERIOR_POINTERS
19+
CFLAGS= -O -DALL_INTERIOR_POINTERS -I$(srcdir)/include
2220
# Setjmp_test may yield overly optimistic results when compiled
2321
# without optimization.
2422

23+
CXXFLAGS= $(CFLAGS)
2524
AR= ar
2625
RANLIB= ar s
2726

@@ -34,26 +33,22 @@ OBJS= alloc.o reclaim.o allchblk.o misc.o mach_dep.o os_dep.o mark_rts.o headers
3433

3534
CORD_OBJS= cord/cordbscs.o cord/cordxtra.o cord/cordprnt.o
3635

37-
CORD_INCLUDE_FILES= $(srcdir)/gc.h $(srcdir)/include/cord.h \
36+
CORD_INCLUDE_FILES= $(srcdir)/include/gc.h $(srcdir)/include/cord.h \
3837
$(srcdir)/include/ec.h $(srcdir)/include/cord_pos.h
3938

4039
# Libraries needed for curses applications. Only needed for de.
4140
CURSES= -lcurses -ltermlib
4241

43-
# The following is irrelevant on most systems. But a few
44-
# versions of make otherwise fork the shell specified in
45-
# the SHELL environment variable.
46-
SHELL= bash
47-
48-
SPECIALCFLAGS =
42+
SPECIALCFLAGS = -I$(srcdir)/include
4943
# Alternative flags to the C compiler for mach_dep.c.
5044
# Mach_dep.c often doesn't like optimization, and it's
5145
# not time-critical anyway.
5246

5347
all: gc.a gctest.exe
5448

55-
$(OBJS) test.o: $(srcdir)/gc_priv.h $(srcdir)/gc_hdrs.h $(srcdir)/gc.h \
56-
$(srcdir)/gcconfig.h $(srcdir)/gc_typed.h
49+
$(OBJS) test.o: $(srcdir)/include/private/gc_priv.h \
50+
$(srcdir)/include/private/gc_hdrs.h $(srcdir)/include/gc.h \
51+
$(srcdir)/include/private/gcconfig.h $(srcdir)/include/gc_typed.h
5752
# The dependency on Makefile is needed. Changing
5853
# options affects the size of GC_arrays,
5954
# invalidating all .o files that rely on gc_priv.h
@@ -68,13 +63,12 @@ cords: $(CORD_OBJS) cord/cordtest.exe
6863
$(AR) ru gc.a $(CORD_OBJS)
6964
$(RANLIB) gc.a
7065

71-
gc_cpp.o: $(srcdir)/gc_cpp.cc $(srcdir)/gc_cpp.h
72-
$(CXX) -c -O $(srcdir)/gc_cpp.cc
66+
gc_cpp.o: $(srcdir)/gc_cpp.cc $(srcdir)/include/gc_cpp.h
67+
$(CXX) -c $(CXXFLAGS) $(srcdir)/gc_cpp.cc
7368

74-
c++: gc_cpp.o $(srcdir)/gc_cpp.h
69+
c++: gc_cpp.o $(srcdir)/include/gc_cpp.h
7570
$(AR) ru gc.a gc_cpp.o
7671
$(RANLIB) gc.a
77-
cp $(srcdir)/gc_cpp.h include/gc_cpp.h
7872

7973
mach_dep.o: $(srcdir)/mach_dep.c
8074
$(CC) -o mach_dep.o -c $(SPECIALCFLAGS) $(srcdir)/mach_dep.c
@@ -109,7 +103,7 @@ gctest.exe: tests/test.o gc.a
109103
# If an optimized setjmp_test generates a segmentation fault,
110104
# odds are your compiler is broken. Gctest may still work.
111105
# Try compiling setjmp_t.c unoptimized.
112-
setjmp_test.exe: $(srcdir)/tools/setjmp_t.c $(srcdir)/gc.h
106+
setjmp_test.exe: $(srcdir)/tools/setjmp_t.c $(srcdir)/include/gc.h
113107
$(CC) $(CFLAGS) -o setjmp_test.exe $(srcdir)/tools/setjmp_t.c
114108

115109
test: setjmp_test.exe gctest.exe

0 commit comments

Comments
 (0)