# This file is part of icobundle # Copyright (C) 2003-8 Toby Thain, toby@telegraphics.com.au # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # GNU Makefile # Win32 cross-compiler MINGW_CC = i386-mingw32msvc-gcc VERSION := $(shell perl -n -e 'm/^\#\w+\s+VERSION_STR\s+\"([^"]*)\"/ && print $$1;' version.h) CFLAGS += -O2 -W -Wall -I../common/tt -I../icoformat -DCMDLINE DISTARCHIVE = dist/icobundle-dos.zip DISTDMG = dist/icobundle-$(VERSION).dmg SRC = file_io.c file_compat_unix.c ico_io.c vpath %.c ../common/tt ../icoformat OBJ := $(patsubst %.c,obj/%.o,$(SRC)) OBJW32 := $(patsubst %.c,obj_w32/%.o,$(SRC)) all : icocheck icobundle fat : icocheck icobundle fat : CFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 fat : LDFLAGS += -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 exe : icocheck.exe icobundl.exe $(DISTARCHIVE) : dist/README.html COPYING icocheck.exe icobundl.exe zip -j -9 $@ $^ ls -l $@ clean : rm -f icocheck icobundle icocheck.exe icobundl.exe obj/*.o obj_w32/*.o $(DISTARCHIVE) icocheck : obj/icocheck.o $(OBJ) $(CC) -o $@ $^ $(LDFLAGS) icobundle : obj/icobundle.o obj/bundle.o $(OBJ) $(CC) -o $@ $^ $(LDFLAGS) icocheck.exe : obj_w32/icocheck.o $(OBJW32) $(MINGW_CC) -o $@ $^ icobundl.exe : obj_w32/icobundle.o obj_w32/bundle.o $(OBJW32) $(MINGW_CC) -o $@ $^ dist : $(DISTARCHIVE) dmg : $(DISTDMG) # create an Apple disk image (dmg) archive of the distribution kit $(DISTDMG) : icocheck icobundle dist/README.html dist/COPYING DIR=`mktemp -d icobundle-XXXX`; \ cp -Rp dist/README.html dist/COPYING icocheck icobundle $$DIR; \ hdiutil create -srcfolder $$DIR -ov -volname "icobundle $(VERSION)" $@; \ rm -fr $$DIR @ ls -l $@ obj/%.o : %.c $(CC) -o $@ -c $< $(CFLAGS) $(CPPFLAGS) obj_w32/%.o : %.c $(MINGW_CC) -o $@ -c $< $(CFLAGS) $(CPPFLAGS)