2011-09-10 11:13:51 +02:00
|
|
|
#! /usr/bin/env python
|
|
|
|
# encoding: utf-8
|
|
|
|
# Chris Pickel, 2011
|
|
|
|
|
|
|
|
VERSION='0.0.1'
|
|
|
|
APPNAME='mac_app_test'
|
|
|
|
|
|
|
|
top = '.'
|
|
|
|
out = 'build'
|
|
|
|
|
|
|
|
def options(opt):
|
|
|
|
opt.load('compiler_c')
|
2011-11-20 14:47:27 +01:00
|
|
|
try:
|
|
|
|
# you must include the xcode generator in your waf file if you want to use it
|
|
|
|
opt.load('xcode')
|
|
|
|
except ImportError:
|
|
|
|
pass
|
2011-09-10 11:13:51 +02:00
|
|
|
|
|
|
|
def configure(conf):
|
|
|
|
conf.load('compiler_c')
|
2012-08-04 02:41:22 +02:00
|
|
|
if not conf.env.ARCH_ST:
|
|
|
|
conf.fatal('This example is for macs only')
|
2011-12-17 16:35:20 +01:00
|
|
|
conf.env.FRAMEWORK_COCOA = 'Cocoa'
|
|
|
|
conf.env.ARCH_COCOA = ['i386', 'x86_64']
|
2011-09-10 11:13:51 +02:00
|
|
|
|
|
|
|
def build(bld):
|
|
|
|
bld.program(
|
2015-06-27 15:18:57 +02:00
|
|
|
features = 'c cprogram',
|
|
|
|
target = 'MacApp',
|
|
|
|
source = 'sources/main.m',
|
|
|
|
mac_app = True,
|
|
|
|
mac_plist = 'Info.plist',
|
|
|
|
mac_files = bld.path.ant_glob('resources/**'),
|
|
|
|
mac_files_root = 'resources',
|
|
|
|
use = 'COCOA',
|
|
|
|
install_path = '${PREFIX}',
|
2011-09-10 11:13:51 +02:00
|
|
|
)
|
|
|
|
|
2012-06-16 02:16:18 +02:00
|
|
|
return
|
|
|
|
# obscure iphone stuff
|
|
|
|
|
|
|
|
bld.env.LIPO = '/usr/bin/lipo'
|
|
|
|
ARCH = {'arm6':'arm6', 'cocoa': ['i386', 'x64']}
|
|
|
|
for arch, val in ARCH.items():
|
|
|
|
bld.env.ARCH = val
|
|
|
|
bld(source='sources/dump_sbpl.c', target='%s/dump_sbpl' % arch, features='c cprogram')
|
|
|
|
|
|
|
|
bld(rule='touch ${TGT} # ${LIPO} -create ${SRC} -output ${TGT}',
|
|
|
|
shell = True,
|
|
|
|
target = 'dump_sbpl.app/dump_sbpl',
|
|
|
|
source = ['%s/dump_sbpl' % x for x in ARCH.keys()]
|
|
|
|
)
|
|
|
|
|
2011-09-10 11:13:51 +02:00
|
|
|
from waflib import TaskGen
|
|
|
|
@TaskGen.extension('.m')
|
|
|
|
def m_hook(self, node):
|
|
|
|
"""Alias .m files to be compiled the same as .c files, gcc will do the right thing."""
|
|
|
|
return self.create_compiled_task('c', node)
|
|
|
|
|
|
|
|
# -*- indent-tabs-mode: t -*-
|