Files
cpython/Mac/PythonLauncher/Makefile.in
Ned Deily 0da5466650 bpo-26317: Support OBJC and OBJCXX configure command line variables (GH-20176)
Add support to the configure script for OBJC and OBJCXX command line options so that the macOS builds can use the clang compiler for the macOS-specific Objective C source files. This allows third-party compilers, like GNU gcc, to be used to build the rest of the project since some of the Objective C system header files are not compilable by GNU gcc.

Co-authored-by: Jeffrey Kintscher <websurfer@surf2c.net>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-05-18 09:17:22 -04:00

79 lines
2.9 KiB
Makefile

CC=@CC@
LD=@CC@
OBJC=@OBJC@
OBJCFLAFS=@OBJCFLAGS@
BASECFLAGS=@BASECFLAGS@
OPT=@OPT@
CFLAGS=@CFLAGS@ $(BASECFLAGS) $(OPT)
LDFLAGS=@LDFLAGS@
srcdir= @srcdir@
VERSION= @VERSION@
UNIVERSALSDK=@UNIVERSALSDK@
builddir= ../..
RUNSHARED= @RUNSHARED@
BUILDEXE= @BUILDEXEEXT@
BUILDPYTHON= $(builddir)/python$(BUILDEXE)
PYTHONFRAMEWORK=@PYTHONFRAMEWORK@
# Deployment target selected during configure, to be checked
# by distutils
MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
@EXPORT_MACOSX_DEPLOYMENT_TARGET@export MACOSX_DEPLOYMENT_TARGET
PYTHONAPPSDIR=@FRAMEWORKINSTALLAPPSPREFIX@/$(PYTHONFRAMEWORK) $(VERSION)
OBJECTS=FileSettings.o MyAppDelegate.o MyDocument.o PreferencesWindowController.o doscript.o main.o
install: Python\ Launcher.app
test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)"
-test -d "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app"
/bin/cp -r "Python Launcher.app" "$(DESTDIR)$(PYTHONAPPSDIR)"
touch "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app"
clean:
rm -f *.o "Python Launcher"
rm -rf "Python Launcher.app"
rm -f Info.plist
Python\ Launcher.app: Info.plist \
Python\ Launcher $(srcdir)/../Icons/PythonLauncher.icns \
$(srcdir)/../Icons/PythonSource.icns \
$(srcdir)/../Icons/PythonCompiled.icns \
$(srcdir)/factorySettings.plist
rm -fr "Python Launcher.app"
mkdir "Python Launcher.app"
mkdir "Python Launcher.app/Contents"
mkdir "Python Launcher.app/Contents/MacOS"
mkdir "Python Launcher.app/Contents/Resources"
cp "Python Launcher" "Python Launcher.app/Contents/MacOS"
cp Info.plist "Python Launcher.app/Contents"
cp $(srcdir)/../Icons/PythonLauncher.icns "Python Launcher.app/Contents/Resources"
cp $(srcdir)/../Icons/PythonSource.icns "Python Launcher.app/Contents/Resources"
cp $(srcdir)/../Icons/PythonCompiled.icns "Python Launcher.app/Contents/Resources"
cp $(srcdir)/factorySettings.plist "Python Launcher.app/Contents/Resources"
cp -R $(srcdir)/English.lproj "Python Launcher.app/Contents/Resources"
FileSettings.o: $(srcdir)/FileSettings.m
$(OBJC) $(CFLAGS) -o $@ -c $(srcdir)/FileSettings.m
MyAppDelegate.o: $(srcdir)/MyAppDelegate.m
$(OBJC) $(CFLAGS) -o $@ -c $(srcdir)/MyAppDelegate.m
MyDocument.o: $(srcdir)/MyDocument.m
$(OBJC) $(CFLAGS) -o $@ -c $(srcdir)/MyDocument.m
PreferencesWindowController.o: $(srcdir)/PreferencesWindowController.m
$(OBJC) $(CFLAGS) -o $@ -c $(srcdir)/PreferencesWindowController.m
doscript.o: $(srcdir)/doscript.m
$(OBJC) $(CFLAGS) -o $@ -c $(srcdir)/doscript.m
main.o: $(srcdir)/main.m
$(OBJC) $(CFLAGS) -o $@ -c $(srcdir)/main.m
Python\ Launcher: $(OBJECTS)
$(OBJC) $(LDFLAGS) -o "Python Launcher" $(OBJECTS) -framework AppKit -framework Carbon
Info.plist: $(srcdir)/Info.plist.in
sed 's/%VERSION%/'"`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(srcdir)/Info.plist.in > Info.plist