prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = $(exec_prefix)/lib #libdir = @libdir@ includedir = @includedir@ datarootdir = @datarootdir@ datadir = @datadir@ mandir = @mandir@ TCLSH_PROG = @TCLSH_PROG@ TCL_VERSION = @TCL_VERSION@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_STUB_LIB_SPEC= @TCL_STUB_LIB_SPEC@ TK_LIBS = @TK_LIBS@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_STUB_LIB_SPEC= @TK_STUB_LIB_SPEC@ tifftcl_LIB_SPEC= @tifftcl_LIB_SPEC@ pngtcl_LIB_SPEC = @pngtcl_LIB_SPEC@ jpegtcl_LIB_SPEC= @jpegtcl_LIB_SPEC@ zlibtcl_LIB_SPEC= @zlibtcl_LIB_SPEC@ tkimg_LIB_SPEC = @tkimg_LIB_SPEC@ tkimggif_LIB_SPEC= @tkimggif_LIB_SPEC@ tkimgjpeg_LIB_SPEC= @tkimgjpeg_LIB_SPEC@ tkimgpng_LIB_SPEC= @tkimgpng_LIB_SPEC@ tkimgtiff_LIB_SPEC= @tkimgtiff_LIB_SPEC@ tkimgwindow_LIB_SPEC= @tkimgwindow_LIB_SPEC@ tcliis_LIB_SPEC = @tcliis_LIB_SPEC@ tclsignal_LIB_SPEC= @tclsignal_LIB_SPEC@ tclxml_LIB_SPEC = @tclxml_LIB_SPEC@ tls_LIB_SPEC=@tls_LIB_SPEC@ tkblt_LIB_SPEC = @tkblt_LIB_SPEC@ tkhtml1_LIB_SPEC= @tkhtml1_LIB_SPEC@ tkmacosx_LIB_SPEC= @tkmacosx_LIB_SPEC@ tkmpeg_LIB_SPEC = @tkmpeg_LIB_SPEC@ tksao_LIB_SPEC = @tksao_LIB_SPEC@ tktable_LIB_SPEC= @tktable_LIB_SPEC@ CC = @CC@ CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ CFLAGS_WARNING = @CFLAGS_WARNING@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@ PKG_CFLAGS = @PKG_CFLAGS@ DEFS = @DEFS@ $(PKG_CFLAGS) CPPFLAGS = @CPPFLAGS@ LIBS = @PKG_LIBS@ @LIBS@ @SSLLIBS@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) .SUFFIXES: .c .C .$(OBJEXT) .c.@OBJEXT@: $(COMPILE) -c $< -o $@ .C.@OBJEXT@: $(COMPILE) -c $< -o $@ #--------------------------defines APPDIR = $(bindir)/SAOImageDS9.app MACDIR = $(APPDIR)/Contents/MacOS LIBDIR = $(APPDIR)/Contents/Frameworks/Tksao.framework/Resources TCLSRC = $(prefix)/build/tcl/Tcl.framework/Versions/$(TCL_VERSION) #TCLSRCD = $(prefix)/build/tcl/Development TCLDIR = $(APPDIR)/Contents/Frameworks/Tcl.framework TKSRC = $(prefix)/build/tk/Tk.framework/Versions/$(TCL_VERSION) #TKSRCD = $(prefix)/build/tk/Development TKDIR = $(APPDIR)/Contents/Frameworks/Tk.framework ID = $(shell finger $(shell whoami) | egrep -o 'Name: [a-zA-Z0-9 ]{1,}' | cut -d ':' -f 2 | head -n 1 | xargs echo) OBJS = ds9.o tkAppInit.o empty:= space:=$(empty) $(empty) SPECS = \ $(jpegtcl_LIB_SPEC) \ $(pngtcl_LIB_SPEC) \ $(tifftcl_LIB_SPEC) \ $(zlibtcl_LIB_SPEC) \ $(tcliis_LIB_SPEC) \ $(tclsignal_LIB_SPEC) \ $(tclxml_LIB_SPEC) \ $(tclzvfs_LIB_SPEC) \ $(tls_LIB_SPEC) \ $(tkblt_LIB_SPEC) \ $(tkhtml1_LIB_SPEC) \ $(tkimg_LIB_SPEC) \ $(tkimggif_LIB_SPEC) \ $(tkimgjpeg_LIB_SPEC) \ $(tkimgpng_LIB_SPEC) \ $(tkimgtiff_LIB_SPEC) \ $(tkimgwindow_LIB_SPEC) \ $(tkmpeg_LIB_SPEC) \ $(tksao_LIB_SPEC) \ $(tktable_LIB_SPEC) \ $(tkmacosx_LIB_SPEC) \ $(TK_STUB_LIB_SPEC) \ $(TCL_STUB_LIB_SPEC) LLIBS = \ $(libdir)/libfuntools.a \ $(libdir)/libast.a \ $(libdir)/libast_err.a \ $(libdir)/libast_pal.a \ $(libdir)/libxpa.a \ $(subst /$(space),/,$(patsubst -L%,%/,$(patsubst -l%,lib%.a,$(SPECS)))) PREQS = \ $(APPDIR) \ $(TCLDIR)/Tcl \ $(TCLDIR)/Resources \ $(TKDIR)/Tk \ $(TKDIR)/Resources \ $(LIBDIR)/library \ $(LIBDIR)/msgs \ $(LIBDIR)/doc \ $(LIBDIR)/cmaps \ $(LIBDIR)/template \ $(LIBDIR)/tls \ $(LIBDIR)/tkblt \ $(LIBDIR)/tkcon \ $(LIBDIR)/base64 \ $(LIBDIR)/ftp \ $(LIBDIR)/log \ $(LIBDIR)/textutil \ $(LIBDIR)/math \ $(LIBDIR)/xpans \ $(LIBDIR)/pcc-i386-snowleopard.tar.gz #--------------------------main .NOTPARALLEL : .PHONY : debug $(MACDIR)/ds9 : ds9base $(PREQS) cp -p ds9base "$@" strip "$@" install_name_tool -change \ /Library/Frameworks/Tcl.framework/Versions/$(TCL_VERSION)/Tcl \ @executable_path/../Frameworks/Tcl.framework/Tcl \ "$@" install_name_tool -change \ /Library/Frameworks/Tk.framework/Versions/$(TCL_VERSION)/Tk \ @executable_path/../Frameworks/Tk.framework/Tk \ "$@" # cd $(bindir); codesign --deep -f -s "$(ID)" SAOImageDS9.app debug : ds9base $(PREQS) cp -p ds9base $(APPDIR)/Contents/MacOS/ds9 install_name_tool -change \ /Library/Frameworks/Tcl.framework/Versions/$(TCL_VERSION)/Tcl \ @executable_path/../Frameworks/Tcl.framework/Tcl \ $(APPDIR)/Contents/MacOS/ds9 install_name_tool -change \ /Library/Frameworks/Tk.framework/Versions/$(TCL_VERSION)/Tk \ @executable_path/../Frameworks/Tk.framework/Tk \ $(APPDIR)/Contents/MacOS/ds9 # cd $(bindir); codesign --deep -f -s "$(ID)" SAOImageDS9.app tkAppInit.o : tkAppInit.c $(COMPILE) -DTK_LOCAL_APPINIT=SAOAppInit \ -DTK_LOCAL_MAIN_HOOK=SAOLocalMainHook -c tkAppInit.c -o $@ tkAppInit.c : $(prefix)/tk$(TCL_VERSION)/unix/tkAppInit.c cp $(prefix)/tk$(TCL_VERSION)/unix/tkAppInit.c . ds9base : $(OBJS) $(LLIBS) $(RM) $@ $(CC) $(CFLAGS) -o $@ \ $(OBJS) \ $(LLIBS) \ $(TK_LIB_SPEC) \ $(TCL_LIB_SPEC) \ $(TK_LIBS) \ $(LIBS) # update date/time so we know when the build was done $(APPDIR): cp -rf SAOImageDS9.app $(bindir) $(TCLDIR)/Tcl : $(TCLSRC)/Tcl cp -p $? "$@" $(TCLDIR)/Resources : $(TCLSRC)/Resources cp -prf $? "$@" $(TKDIR)/Tk : $(TKSRC)/Tk cp -p $? "$@" $(TKDIR)/Resources : $(TKSRC)/Resources cp -prf $? "$@" rm -rf "$@"/Wish* $(LIBDIR)/xpans : $(bindir)/xpans cp -p $? "$@" $(LIBDIR)/pcc-i386-snowleopard.tar.gz: $(prefix)/compilers/pcc-i386-snowleopard.tar.gz cp -p $? "$@" #--------------------------clean .PHONY : clean clean : parsersclean $(RM) core *~ *# *.o $(RM) -rf $(APPDIR) include ../make.include