# Makefile # # Makefile for Mac OS X for PHYLIP 3.6. PACKAGE=phylip VERSION=3.69 # We use GNU's version of the make utility. It may be called "gmake" on # your system. # # If you're using a Mac OS X system with default locations for # gcc libraries, you probably don't need to change anything. You might # might change the first noncomment statement below to redefine $(EXEDIR) # if you'd like your executables installed in a different location than # our default. # # Users with systems that differ substantially from ours may need to set # the following variables: $(CC) $(CFLAGS) $(DFLAGS) $(LIBS) $(DLIBS) # # When uncompressed and extracted, the tar archive phylip-3.6x.tar.gz # produces the following directory structure: # # phylip-3.6x/src -- the source code, including this file, Makefile.osx # phylip-3.6x/exe -- executables, changed by changing $(EXEDIR) value # phylip-3.6x/doc -- html documentation # # To use the PHYLIP v3.6 Makefile, type from the phylip-3.6x/src directory: # cp Makefile Makefile.unix # cp Makefile.osx Makefile # and then do one of the following. (You can skip the copying steps # above and use "make -f Makefile.osx ..." instead if you like.) # # make install to compile the whole package and install # the executables in $(EXEDIR), and then # remove the object files to save space # # make all to compile the whole package but not install it # or remove the object files. # # make put to move the executables into $(EXEDIR) # # make clean to remove all object files and executables from the # current directory # # make dnaml.app to compile, link, and make a clickable executable # for one program. The executables will stay # in the src directory. # # make dnaml.install to compile, link, make a clickable executable, # for one program and move the executable to the # executables directory # # ---------------------------------------------------------------------------- # (Starting here is the section where you may want to change things) # ---------------------------------------------------------------------------- # # the following specifies the directory where the executables will be placed EXEDIR = ../exe # # ---------------------------------------------------------------------------- # # The following statements set these variables: # # CC -- the name (and, optionally, location) of your C compiler # CFLAGS -- compiler directives needed to compile most programs # DFLAGS -- compiler directives needed to compile draw programs # LIBS -- non-default system libraries needed to compile most programs # DLIBS -- non-default system libraries needed to compile draw programs # # We've provided a set of possible values for each variable. # # The value used is the one without a "#" at the beginning of the line. # # To try an alternate value, make sure the one you want has no "#" # as its first character and that all other possibilities have "#" for # their first character. # # Advanced users may need to further edit one of the alternatives in # order to correctly compile on their system. # # ---------------------------------------------------------------------------- # # The next two assignments are the invocations of the compiler # # This one specifies the "cc" C compiler CC = cc # # To use GCC instead: #CC = gcc # # ---------------------------------------------------------------------------- # # This is the CFLAGS statement. It specifies compiler behavior. # # Here are some possible CFLAGS statements: # # #A minimal one #CFLAGS = # # A basic one for debugging #CFLAGS = -g # # An optimized one for gcc #CFLAGS = -O3 -fomit-frame-pointer # # For some serious debugging using Gnu gcc # #CFLAGS=-g -Wall -Wmain -Wmissing-prototypes -Wreturn-type -Wstrict-prototypes -Wunused -Werror -Wredundant-decls -Waggregate-return -Wcast-align -Wcomment # # For making universal binaries # theoretically this could also include "-arch ppc64", but that didn't # work for us # CFLAGS = -O3 -Wall -arch ppc -arch i386 -mmacosx-version-min=10.1 # For making non-universal binaries for your processor CFLAGS = -O3 -Wall -mmacosx-version-min=10.1 # # ---------------------------------------------------------------------------- # # This is the DFLAGS statement. It specifies compiler behavior for the # programs drawgram and drawtree. It adds additional information to # the $(CFLAGS) value so these programs can use graphics. # # A minimal one -- drawing programs will run, but will not use graphics. # If you use this one, you must also use the minimal value for $(DLIBS) #DFLAGS = $(CFLAGS) -DX # # to use Mac Carbon graphics (use only for Intel). # You should also use the Carbon version of DLIBS DFLAGS = -O3 -Wall -arch i386 -mmacosx-version-min=10.1 -DMAC -DOSX_CARBON # # to use Mac Carbon graphics (use only for PPC). Uses 32 bit PPC code only. # You should also use the Carbon version of DLIBS #DFLAGS = -O3 -Wall -arch ppc -mmacosx-version-min=10.1 -DMAC -DOSX_CARBON # # Compiling universal binaries for draw programs using Carbon for PPC # need to specify 32 bit for the PPC part #DFLAGS = -O3 -Wall -arch ppc -arch i386 -mmacosx-version-min=10.1 -DMAC -DOSX_CARBON # # ---------------------------------------------------------------------------- # # Most of the programs need only the math libraries, specified like this; # LIBS = -lm # # The drawing programs also need access to the X windowing system. This is # specified with the DLIBS variable. # # A minimal one -- drawing programs will run, but will not use graphics. # you must also set DFLAGS to the minimal value #DLIBS = $(CLIBS) # # to use Mac Carbon graphics. You should also use the Carbon version # of DFLAGS DLIBS=-framework Carbon # -framework AppKit -framework ApplicationServices # ---------------------------------------------------------------------------- # (After this point there should not be any reason to change anything # except for the commands at the bottom which add the icons in Mac OS X) # ---------------------------------------------------------------------------- # # # the list of programs # draw programs are listed last since they are the most likely to cause # compilation or linking problems PROGS = clique \ consense \ contml \ contrast \ dnacomp \ dnadist \ dnainvar \ dnaml \ dnamlk \ dnamove \ dnapars \ dnapenny \ dolmove \ dollop \ dolpenny \ factor \ fitch \ gendist \ kitsch \ mix \ move \ neighbor \ pars \ penny \ proml \ promlk \ protdist \ protpars \ restdist \ restml \ retree \ seqboot \ treedist \ drawgram \ drawtree APPS = clique.app consense.app contml.app contrast.app dnacomp.app \ dnadist.app dnainvar.app dnaml.app dnamlk.app dnamove.app \ dnapars.app dnapenny.app dollop.app dolmove.app dolpenny.app \ drawgram.app drawtree.app factor.app fitch.app gendist.app \ kitsch.app mix.app move.app neighbor.app pars.app penny.app \ proml.app promlk.app protdist.app protpars.app restdist.app \ restml.app retree.app seqboot.app treedist.app # # general commands # # The first target it executed if you just type "make". It tells you how to # use the Makefile. # help: @echo "" @echo " To use the PHYLIP v3.6 Makefile, type" @echo " make install to compile the whole package and install" @echo " the executables in $(EXEDIR), and then" @echo " remove the object files to save space" @echo " make all to compile the whole package but not install it" @echo " or remove the object files" @echo " make put to move the executables into $(EXEDIR)" @echo " make clean to remove all object files and executables from the" @echo " current directory" @echo " make dnaml.app to compile, link, and make a clickable executable" @echo " for one program (in this example, dnaml)." @echo " The executables will stay in the src directory." @echo " make dnaml.install to compile, link, make a clickable executable," @echo " for one program and move the executable" @echo " to the executables directory" @echo " " introduce: @echo "Building PHYLIP version $(VERSION)" all: introduce $(PROGS) @echo "Finished compiling." @echo "" install: pre-clean apps put clean @echo "Done." @echo "" # For making clickable executables. apps: $(APPS) put: @echo "Installing PHYLIP v3.6 binaries in $(EXEDIR)" @mkdir -p '$(EXEDIR)' @for i in $(APPS) ; do \ rm -rf "$(EXEDIR)/$$i" ; \ done @mv $(APPS) '$(EXEDIR)' @cp linkmac '$(EXEDIR)' @echo "Installing font files in $(EXEDIR)" @cp font* '$(EXEDIR)' @echo "Finished installation." @echo "" pre-clean: @echo "Removing preexisting executables" @for i in $(APPS) ; do \ rm -rf "$(EXEDIR)/$$i" ; \ done @echo "Ready for new executables" @echo "" clean: @echo "Removing object files to save space" @rm -f *.o @echo "Finished removing object files. Now will remove" @echo "executable files from the current directory, but not from the" @echo "executables directory. (If some are not here, the makefile" @echo "will terminate with an error message but this is not a problem)" @echo "" @echo "Removing executables from this directory" @rm -f $(PROGS) @rm -rf $(APPS) @echo "Finished cleanup." @echo "" # # compile object files shared between programs # (make's implicit rule for %.o will take care of these) # phylip.o: phylip.h seq.o: phylip.h seq.h disc.o: phylip.h disc.h discrete.o: phylip.h discrete.h dollo.o: phylip.h dollo.h wagner.o: phylip.h wagner.h dist.o: phylip.h dist.h cont.o: phylip.h cont.h mlclock.o: phylip.h mlclock.h moves.o: phylip.h moves.h printree.o: phylip.h printree.h # # compile the individual programs # clique.o: clique.c disc.h phylip.h clique: clique.o disc.o phylip.o $(CC) $(CFLAGS) clique.o disc.o phylip.o $(LIBS) -o clique cons.o: cons.c cons.h phylip.h consense.o: consense.c cons.h phylip.h consense: consense.o phylip.o cons.o $(CC) $(CFLAGS) consense.o phylip.o cons.o $(LIBS) -o consense contml.o: contml.c cont.h phylip.h contml: contml.o cont.o phylip.o $(CC) $(CFLAGS) contml.o cont.o phylip.o $(LIBS) -o contml contrast.o: contrast.c cont.h phylip.h contrast: contrast.o cont.o phylip.o $(CC) $(CFLAGS) contrast.o cont.o phylip.o $(LIBS) -o contrast dnacomp.o: dnacomp.c seq.h phylip.h dnacomp: dnacomp.o seq.o phylip.o $(CC) $(CFLAGS) dnacomp.o seq.o phylip.o $(LIBS) -o dnacomp dnadist.o: dnadist.c seq.h phylip.h dnadist: dnadist.o seq.o phylip.o $(CC) $(CFLAGS) dnadist.o seq.o phylip.o $(LIBS) -o dnadist dnainvar.o: dnainvar.c seq.h phylip.h dnainvar: dnainvar.o seq.o phylip.o $(CC) $(CFLAGS) dnainvar.o seq.o phylip.o $(LIBS) -o dnainvar dnaml.o: dnaml.c seq.h phylip.h dnaml: dnaml.o seq.o phylip.o $(CC) $(CFLAGS) dnaml.o seq.o phylip.o $(LIBS) -o dnaml dnamlk.o: dnamlk.c seq.h phylip.h mlclock.h printree.h dnamlk: dnamlk.o seq.o phylip.o mlclock.o printree.o $(CC) $(CFLAGS) dnamlk.o seq.o phylip.o mlclock.o printree.o $(LIBS) -o dnamlk dnamove.o: dnamove.c seq.h moves.h phylip.h dnamove: dnamove.o seq.o moves.o phylip.o $(CC) $(CFLAGS) dnamove.o seq.o moves.o phylip.o $(LIBS) -o dnamove dnapenny.o: dnapenny.c seq.h phylip.h dnapenny: dnapenny.o seq.o phylip.o $(CC) $(CFLAGS) dnapenny.o seq.o phylip.o $(LIBS) -o dnapenny dnapars.o: dnapars.c seq.h phylip.h dnapars: dnapars.o seq.o phylip.o $(CC) $(CFLAGS) dnapars.o seq.o phylip.o $(LIBS) -o dnapars dolmove.o: dolmove.c disc.h moves.h dollo.h phylip.h dolmove: dolmove.o disc.o moves.o dollo.o phylip.o $(CC) $(CFLAGS) dolmove.o disc.o moves.o dollo.o phylip.o $(LIBS) -o dolmove dollop.o: dollop.c disc.h dollo.h phylip.h dollop: dollop.o disc.o dollo.o phylip.o $(CC) $(CFLAGS) dollop.o disc.o dollo.o phylip.o $(LIBS) -o dollop dolpenny.o: dolpenny.c disc.h dollo.h phylip.h dolpenny: dolpenny.o disc.o dollo.o phylip.o $(CC) $(CFLAGS) dolpenny.o disc.o dollo.o phylip.o $(LIBS) -o dolpenny draw.o: draw.c draw.h phylip.h interface.h $(CC) $(DFLAGS) -c draw.c draw2.o: draw2.c draw.h phylip.h $(CC) $(DFLAGS) -c draw2.c drawgram.o: drawgram.c draw.h phylip.h $(CC) $(DFLAGS) -c drawgram.c drawgram: drawgram.o draw.o draw2.o phylip.o interface.o $(CC) $(DFLAGS) draw.o draw2.o drawgram.o phylip.o interface.o $(DLIBS) -o drawgram drawtree.o: drawtree.c draw.h phylip.h $(CC) $(DFLAGS) -c drawtree.c drawtree: drawtree.o draw.o draw2.o phylip.o interface.o $(CC) $(DFLAGS) draw.o draw2.o drawtree.o phylip.o interface.o $(DLIBS) -o drawtree factor.o: factor.c phylip.h factor: factor.o phylip.o $(CC) $(CFLAGS) factor.o phylip.o $(LIBS) -o factor fitch.o: fitch.c dist.h phylip.h fitch: fitch.o dist.o phylip.o $(CC) $(CFLAGS) fitch.o dist.o phylip.o $(LIBS) -o fitch gendist.o: gendist.c phylip.h gendist: gendist.o phylip.o $(CC) $(CFLAGS) gendist.o phylip.o $(LIBS) -o gendist interface.o: interface.c interface.h $(CC) $(DFLAGS) -c interface.c kitsch.o: kitsch.c dist.h phylip.h kitsch: kitsch.o dist.o phylip.o $(CC) $(CFLAGS) kitsch.o dist.o phylip.o $(LIBS) -o kitsch mix.o: mix.c disc.h wagner.h phylip.h mix: mix.o disc.o wagner.o phylip.o $(CC) $(CFLAGS) mix.o disc.o wagner.o phylip.o $(LIBS) -o mix move.o: move.c disc.h moves.h wagner.h phylip.h move: move.o disc.o moves.o wagner.o phylip.o $(CC) $(CFLAGS) move.o disc.o moves.o wagner.o phylip.o $(LIBS) -o move neighbor.o: neighbor.c dist.h phylip.h neighbor: neighbor.o dist.o phylip.o $(CC) $(CFLAGS) neighbor.o dist.o phylip.o $(LIBS) -o neighbor pars.o: pars.c discrete.h phylip.h pars: pars.o discrete.o phylip.o $(CC) $(CFLAGS) pars.o discrete.o phylip.o $(LIBS) -o pars penny.o: penny.c disc.h wagner.h phylip.h penny: penny.o disc.o wagner.o phylip.o $(CC) $(CFLAGS) penny.o disc.o wagner.o phylip.o $(LIBS) -o penny proml.o: proml.c seq.h phylip.h proml: proml.o seq.o phylip.o $(CC) $(CFLAGS) proml.o seq.o phylip.o $(LIBS) -o proml promlk.o: promlk.c seq.h phylip.h mlclock.h printree.h promlk: promlk.o seq.o phylip.o mlclock.o printree.o $(CC) $(CFLAGS) promlk.o seq.o phylip.o mlclock.o printree.o $(LIBS) -o promlk protdist.o: protdist.c seq.h phylip.h protdist: protdist.o seq.o phylip.o $(CC) $(CFLAGS) protdist.o seq.o phylip.o $(LIBS) -o protdist protpars.o: protpars.c seq.h phylip.h protpars: protpars.o seq.o phylip.o $(CC) $(CFLAGS) protpars.o seq.o phylip.o $(LIBS) -o protpars restdist.o: restdist.c seq.h phylip.h restdist: restdist.o seq.o phylip.o $(CC) $(CFLAGS) restdist.o seq.o phylip.o $(LIBS) -o restdist restml.o: restml.c seq.h phylip.h restml: restml.o seq.o phylip.o $(CC) $(CFLAGS) restml.o seq.o phylip.o $(LIBS) -o restml retree.o: retree.c moves.h phylip.h retree: retree.o moves.o phylip.o $(CC) $(CFLAGS) retree.o moves.o phylip.o $(LIBS) -o retree seqboot.o: seqboot.c phylip.h seqboot: seqboot.o seq.o phylip.o $(CC) $(CFLAGS) seqboot.o seq.o phylip.o $(LIBS) -o seqboot treedist.o: treedist.c cons.h phylip.h treedist: treedist.o phylip.o cons.o $(CC) $(CFLAGS) treedist.o cons.o phylip.o $(LIBS) -o treedist # # This is where the clickable executables are made for Mac OSX # %.app: % mac/Info.plist.in mac/command.in mac/%.icns @rm -rf $@ /Developer/Tools/Rez -d __DARWIN__ -t APPL Carbon.r -o $< /Developer/Tools/SetFile -a C $< -mkdir -p $@/Contents/MacOS -mkdir -p $@/Contents/Resources sed -e "s/IDENTIFIER/$ $@/Contents/Info.plist sed -e "s/EXECUTABLE/$ $@/Contents/MacOS/$<.command chmod ug+x $@/Contents/MacOS/$<.command echo -n "APPL????" >$@/Contents/PkgInfo cp $< $@/Contents/MacOS/$< cp -f mac/$<.icns $@/Contents/Resources/$<.icns # Location of the lsregister command to force re-registration with LaunchServices LSREGISTER=/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister %.install: %.app @rm -rf '$(EXEDIR)/$<' @mv $< '$(EXEDIR)'