Commit 7ac954b7 authored by Neil Schemenauer's avatar Neil Schemenauer

- Add CFLAGSFORSHARED variable. configure sets this to CCSHARED if LDLIBRARY

  is a shared library.
- Add PY_CFLAGS variable (flags used to compile the interpreter)
- clobber now just removes object files, libraries and binaries
parent 2f4453af
...@@ -71,6 +71,13 @@ CFLAGS= $(OPT) -I. -I$(srcdir)/Include $(DEFS) ...@@ -71,6 +71,13 @@ CFLAGS= $(OPT) -I. -I$(srcdir)/Include $(DEFS)
LDFLAGS= @LDFLAGS@ LDFLAGS= @LDFLAGS@
LDLAST= @LDLAST@ LDLAST= @LDLAST@
SGI_ABI= @SGI_ABI@ SGI_ABI= @SGI_ABI@
CCSHARED= @CCSHARED@
LINKFORSHARED= @LINKFORSHARED@
# Extra C flags added for building the interpreter object files.
CFLAGSFORSHARED=@CFLAGSFORSHARED@
# C flags used for building the interpreter object files
PY_CFLAGS= $(CFLAGS) $(CFLAGSFORSHARED)
# Machine-dependent subdirectories # Machine-dependent subdirectories
MACHDEP= @MACHDEP@ MACHDEP= @MACHDEP@
...@@ -99,8 +106,6 @@ LIBP= $(LIBDIR)/python$(VERSION) ...@@ -99,8 +106,6 @@ LIBP= $(LIBDIR)/python$(VERSION)
# Symbols used for using shared libraries # Symbols used for using shared libraries
SO= @SO@ SO= @SO@
LDSHARED= @LDSHARED@ LDSHARED= @LDSHARED@
CCSHARED= @CCSHARED@
LINKFORSHARED= @LINKFORSHARED@
DESTSHARED= $(BINLIBDEST)/lib-dynload DESTSHARED= $(BINLIBDEST)/lib-dynload
# Executable suffix (.exe on Windows and Mac OS X) # Executable suffix (.exe on Windows and Mac OS X)
...@@ -131,7 +136,7 @@ DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy ...@@ -131,7 +136,7 @@ DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
DIST= $(DISTFILES) $(DISTDIRS) DIST= $(DISTFILES) $(DISTDIRS)
LIBRARY= libpython$(VERSION).a LIBRARY= @LIBRARY@
LDLIBRARY= @LDLIBRARY@ LDLIBRARY= @LDLIBRARY@
DLLLIBRARY= @DLLLIBRARY@ DLLLIBRARY= @DLLLIBRARY@
...@@ -356,31 +361,24 @@ Modules/Setup: $(srcdir)/Modules/Setup.dist ...@@ -356,31 +361,24 @@ Modules/Setup: $(srcdir)/Modules/Setup.dist
echo "check to make sure you have all the updates you"; \ echo "check to make sure you have all the updates you"; \
echo "need in your Modules/Setup file."; \ echo "need in your Modules/Setup file."; \
echo "-----------------------------------------------"; \ echo "-----------------------------------------------"; \
else cp $(srcdir)/Modules/Setup.dist Modules/Setup; fi fi
Modules/Setup.local:
@echo "# Edit this file for local setup changes" >Modules/Setup.local
############################################################################ ############################################################################
# Special rules for object files # Special rules for object files
Modules/getbuildinfo.o: $(srcdir)/Modules/getbuildinfo.c buildno Modules/getbuildinfo.o: $(srcdir)/Modules/getbuildinfo.c buildno
$(CC) -c $(CFLAGS) -DBUILD=`cat buildno` \ $(CC) -c $(PY_CFLAGS) -DBUILD=`cat buildno` -o $@ $<
$(srcdir)/Modules/getbuildinfo.c \
-o Modules/getbuildinfo.o
Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
$(CC) -c $(CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \ $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
-DPREFIX='"$(prefix)"' \ -DPREFIX='"$(prefix)"' \
-DEXEC_PREFIX='"$(exec_prefix)"' \ -DEXEC_PREFIX='"$(exec_prefix)"' \
-DVERSION='"$(VERSION)"' \ -DVERSION='"$(VERSION)"' \
-DVPATH='"$(VPATH)"' \ -DVPATH='"$(VPATH)"' \
$(srcdir)/Modules/getpath.c -o $@ -o $@ $<
Modules/ccpython.o: Modules/ccpython.cc Modules/ccpython.o: Modules/ccpython.cc
$(CXX) $(CFLAGS) -c $< -o $@ $(CXX) -c $(PY_CFLAGS) -o $@ $<
$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
...@@ -399,12 +397,10 @@ Parser/metagrammar.o: $(srcdir)/Parser/metagrammar.c ...@@ -399,12 +397,10 @@ Parser/metagrammar.o: $(srcdir)/Parser/metagrammar.c
Python/getplatform.o: $(srcdir)/Python/getplatform.c Python/getplatform.o: $(srcdir)/Python/getplatform.c
$(CC) -c $(CFLAGS) -DPLATFORM='"$(MACHDEP)"' \ $(CC) -c $(CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $<
-o Python/getplatform.o $(srcdir)/Python/getplatform.c
Python/importdl.o: $(srcdir)/Python/importdl.c Python/importdl.o: $(srcdir)/Python/importdl.c
$(CC) -c $(CFLAGS) -I$(DLINCLDIR) \ $(CC) -c $(CFLAGS) -I$(DLINCLDIR) -o $@ $<
-o Python/importdl.o $(srcdir)/Python/importdl.c
Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \ Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \
...@@ -717,7 +713,7 @@ config.status: $(srcdir)/configure ...@@ -717,7 +713,7 @@ config.status: $(srcdir)/configure
# Some make's put the object file in the current directory # Some make's put the object file in the current directory
.c.o: .c.o:
$(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $< $(CC) -c $(PY_CFLAGS) -o $@ $<
# Rerun configure with the same options as it was run last time, # Rerun configure with the same options as it was run last time,
# provided the config.status script exists # provided the config.status script exists
...@@ -758,18 +754,15 @@ clean: ...@@ -758,18 +754,15 @@ clean:
-rm -f $(MODOBJS) $(MAINOBJ) $(PGOBJS) -rm -f $(MODOBJS) $(MAINOBJ) $(PGOBJS)
clobber: clean clobber: clean
-rm -f tags TAGS $(PYTHON) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) -rm -f tags TAGS $(PYTHON) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
-rm -f Makefile.pre config.log config.cache config.h setup.cfg Modules/*.so Modules/*.sl
-rm -f Modules/*.so Modules/*.sl
# Make things extra clean, before making a distribution: # Make things extra clean, before making a distribution:
# remove all generated files, even Makefile[.pre] # remove all generated files, even Makefile[.pre]
distclean: clobber distclean: clobber
-$(MAKE) -f $(srcdir)/Makefile.pre.in \ -rm -f Makefile Makefile.pre buildno config.status config.log \
SUBDIRS="$(SUBDIRSTOO)" clobber config.cache config.h setup.cfg Modules/config.c \
-rm -f config.status config.log config.cache config.h Makefile Modules/Setup Modules/Setup.local Modules/Setup.config
-rm -f buildno Modules/Setup Modules/Setup.local Modules/Setup.config
-rm -f Modules/config.c
-for i in $(SUBDIRSTOO); do \ -for i in $(SUBDIRSTOO); do \
for f in $$i/*.in; do \ for f in $$i/*.in; do \
f=`basename "$$f" .in`; \ f=`basename "$$f" .in`; \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment