MAKEFLAGS := $(shell echo -j$$(((1 + 3 * `./cpucount.rb`) / 2))) PRODUCT := simple-text export LIB_NAME := lib$(PRODUCT).a ARCHS := ppc i386 ppc64 x86_64 THIN_LIBS := $(patsubst %,build/%/$(LIB_NAME),$(ARCHS)) FAT_LIB := $(LIB_NAME) all: $(FAT_LIB) $(FAT_LIB): $(THIN_LIBS) lipo $(THIN_LIBS) -create -output $@ build/%/$(LIB_NAME): make -f Arch.mk ARCH=$* clean: rm -rf build $(FAT_LIB) .PHONY: all clean