Source

php-objc / Makefile

Full commit

PHPCONFIG=php-config
PHPCFLAGS=-DPHP_ATOM_INC -DCOMPILE_DL_OBJC -DPIC -I. `$(PHPCONFIG) --includes` -Ilibffi/include -g -Wall  -I/usr/include/libxml2 -arch i386

all: objc.so

PHPOBJC_OBJS=extension.o exception.o bridgesupport.o

*.m: php_objc.h

objc.so: $(PHPOBJC_OBJS) 
	gcc -framework Foundation -framework AppKit -bundle -flat_namespace -undefined suppress -o objc.so $(PHPOBJC_OBJS) -Llibffi/.libs -lffi -arch i386

%.o: %.m
	gcc $(PHPCFLAGS) -c $< -o $@

shim: shim.c
	gcc -o shim shim.c -arch i386

install: objc.so
	install -m 755 objc.so `$(PHPCONFIG) --extension-dir`

dist:
	-rm -rf /tmp/php-objc
	-mkdir /tmp/php-objc
	cp -r *.php *.m *.h TODO README INSTALL samples Makefile utils libffi /tmp/php-objc
	-cd /tmp/php-objc/libffi && make clean
	-cd /tmp/php-objc/ && make clean
	find /tmp/php-objc -type d -name .svn | xargs rm -rf
	cd /tmp && tar cjf /tmp/php-objc.tar.bz2 php-objc

clean:
	rm *.o *.so