@@ -26,13 +26,13 @@ import qualified Data.ByteString.Char8 as B
2626
2727generateMakefile :: IO ()
2828generateMakefile = do
29− makefileExists <- doesFileExist "Makefile"
29+ makefileExists <- doesFileExist makefilename
3030 when (not makefileExists) $ do
3131 let makefile = $(embedFile "pcc/Makefile")
3232 exePath <- getExecutablePath
3333 putStrLn ""
34− putStrLn $ "Generating Makefile... " ++ "pcc executable location " ++ exePath
35− writeFile "Makefile" . T.unpack $
34+ putStrLn $ "Generating " ++ makefilename ++ "... " ++ "pcc executable location " ++ exePath
35+ writeFile makefilename . T.unpack $
3636 T.replace
3737 pathPlaceholder
3838 (T.pack $ takeDirectory exePath)
@@ -48,14 +48,34 @@ generateMakefile = do
4848
4949generatePackagefile :: IO ()
5050generatePackagefile = do
51− pkgfileExists <- doesFileExist "psc-package.json"
51+ pkgfileExists <- doesFileExist packagefilename
5252 when (not pkgfileExists) $ do
5353 let pkgfile = $(embedFile "pcc/psc-package.json")
5454 putStrLn ""
55− putStrLn "Generating psc-package.json..."
56− writeFile "psc-package.json" $ B.unpack pkgfile
55+ putStrLn $ "Generating " ++ packagefilename ++ "..."
56+ writeFile packagefilename $ B.unpack pkgfile
5757 putStrLn "Done"
5858 putStrLn "Use the 'psc-package' utility to install or update packages."
5959
60+generateXcodefile :: IO ()
61+generateXcodefile = do
62+ xcodefileExists <- doesFileExist xcodefilename
63+ when (not xcodefileExists) $ do
64+ let xcodefile = $(embedFile "pcc/psc-xcode.sh")
65+ putStrLn ""
66+ putStrLn $ "Generating " ++ xcodefilename ++ "..."
67+ writeFile xcodefilename $ B.unpack xcodefile
68+ putStrLn "Done"
69+ putStrLn "Add this file to an Xcode 'Run Script' build phase."
70+
71+makefilename :: String
72+makefilename = "Makefile"
73+
74+packagefilename :: String
75+packagefilename = "psc-package.json"
76+
77+xcodefilename :: String
78+xcodefilename = "psc-xcode.sh"
79+
6080pathPlaceholder :: T.Text
6181pathPlaceholder = "{{path}}"