## improv example programs makefile for linux on Intel computers. ## ## Programmer: Craig Stuart Sapp ## Creation Date: Fri Jan 15 05:23:55 PST 1999 ## Last Modified: Thu May 27 23:03:06 PDT 1999 ## Filename: ...improv/Makefile.examples ## ## Description: This Makefile creates example programs which use the ## improv library for linux using gcc 2.7.2.1 or higher ## ## To run this makefile, type (without quotes) "make -f Makefile.examples" ## ## Without arguments, the makefile will compile all example programs. ## If you give a program name as an argument, it will compile ## just that program. E.g.: "make -f Makefile.examples cinmidi" ## will compile the cinmidi program and place it in the ./bin directory. ## ########################################################################### # # # # # Operating System OSTYPEs available in the improv library compilation: # # # LINUX = Linux running on intel computers and OSS sound drivers # VISUAL = Windows 95/NT using Microsoft Visual C++ 5.0/6.0 # # Normally this variable is not needed for compiling programs using the # improv library, since it is in the library creation where the os-specific code # is compiled. Some of the include files will need this define variable. # OSTYPE = LINUX SRCDIR = examples INCDIR = include OBJDIR = obj LIBDIR = lib LIBFILE = improv TARGDIR = bin COMPILER = g++ DEFINES = $(addprefix -D,$(OSTYPE)) # Add -static flag to compile statically for portability PREFLAGS = -pipe -O6 -I$(INCDIR) $(DEFINES) POSTFLAGS = -L/usr/lib -lpthread -L$(LIBDIR) -l$(LIBFILE) # # # End of user-modifiable variables. # # # ########################################################################### # setting up the directory paths to search for program source code vpath %.cpp $(SRCDIR)/improv $(SRCDIR)/synthImprov $(SRCDIR)/batonImprov \ $(SRCDIR)/batonSynthImprov # generating a list of the programs to compile with "make all" PROGS1=$(notdir $(patsubst %.cpp,%,$(wildcard $(SRCDIR)/improv/*.cpp))) PROGS2=$(notdir $(patsubst %.cpp,%,$(wildcard \ $(SRCDIR)/synthImprov/*.cpp))) PROGS3=$(notdir $(patsubst %.cpp,%,$(wildcard \ $(SRCDIR)/batonImprov/*.cpp))) PROGS4=$(notdir $(patsubst %.cpp,%,$(wildcard \ $(SRCDIR)/batonSynthImprov*.cpp))) PROGS=$(PROGS1) $(PROGS2) $(PROGS3) $(PROGS4) # targets which don't actually refer to files .PHONY : all bin 2dpos position1 position2 nana2 ########################################################################### # # # # all: bin $(addprefix $(TARGDIR)/,$(PROGS)) @echo Finished compiling all example programs. improv: bin $(addprefix $(TARGDIR)/,$(PROGS1)) @echo Finished compiling improv example programs. synthImprov: bin $(addprefix $(TARGDIR)/,$(PROGS2)) @echo Finished compiling synthImprov example programs. batonImprov: bin $(addprefix $(TARGDIR)/,$(PROGS3)) @echo Finished compiling batonImprov example programs. batonSynthImprov: bin $(addprefix $(TARGDIR)/,$(PROGS4)) @echo Finished compiling batonSynthImprov example programs. bin: # @echo Programs are: $(PROGS) -mkdir $(TARGDIR) ########################################################################### # programs which can not be compiled in Linux: bin/2dpos: @echo Skipping 2dpos program: compiles only in Windows 95/NT bin/position1: @echo Skipping position1 program: compiles only in Windows 95/NT bin/position2: @echo Skipping position2 program: compiles only in Windows 95/NT bin/nana2: @echo Skipping nana2 program: needs external functions from sigNet. ########################################################################### # defining an explicit rules for program sourcefile dependencies: $(TARGDIR)/% : $(notdir %.cpp) $(COMPILER) $(PREFLAGS) -o $@ $< $(POSTFLAGS) \ && strip $@ % : $(notdir %.cpp) $(COMPILER) $(PREFLAGS) -o $(TARGDIR)/$@ $< $(POSTFLAGS) \ && strip $(TARGDIR)/$@ # # # # ###########################################################################