1# 2# set appropriate the following variables in your environment: 3# 4# CC for the C compiler 5# CFLAGS for options of CC 6# LDFLAGS for linker options of CC 7# 8 9# 10# ARCH_EXT can be used in order to install binaries in different directories 11# depending on the computer architecture, 12# e.g. $(HOME)/lib/sunos for ARCH_EXT = '/sunos' 13# 14#ARCH_EXT = 15 16# 17# set the path for the root of the inlude directories here, 18# e.g. /usr/local/include 19# 20INCROOT = $(HOME)/include 21# 22# set the path for the root of the library directories here, 23# e.g. /usr/local/lib 24# 25LIBROOT = $(HOME)/lib$(ARCH_EXT) 26# 27# set the destination directory for the executable 28# 29DEST = $(HOME)/bin$(ARCH_EXT) 30 31# 32# the following text was created automaticaly. You should change it carefully. 33# 34 35SHELL = /bin/sh 36 37PROGRAM = matropt 38 39HDRS = testproc.h 40 41EXTHDRS = 42 43SRCS = matropt.c \ 44 testproc.c 45 46OBJS = matropt.o \ 47 testproc.o 48 49LIBS = 50 51EXTLIBS = -llaspack -lxc 52 53COMPFLAGS = 54 55# compiler options will be passed throuth enviroment variables 56#CFLAGS = 57#PFLAGS = 58#FFLAGS = 59#CXXFLAGS = 60 61BINLOCAL = /usr/local/bin 62 63INSTALL = mv 64 65LD = $(CC) 66 67# linker options passed throuth enviroment variables 68#LDFLAGS = 69 70LINTLIBS = 71 72LINTFLAGS = -I$(INCROOT) $(CFLAGS) 73 74MAKEFILE = makefile 75 76PRINT = pr 77 78PRINTFLAGS = 79 80LP = lp 81 82LPFLAGS = 83 84all: $(PROGRAM) 85 86clean:; @rm -f $(OBJS) core 87 88clobber:; @rm -f $(OBJS) $(PROGRAM) core tags 89 @if [ -f compllist ]; then rm -f compllist; fi 90 @if [ -f cleanlist ]; then rm -f cleanlist; fi 91 @find . -type f -print > compllist 92 @sed -n \ 93 -e "/~/ w cleanlist" \ 94 -e '/%/ w cleanlist' \ 95 -e '/.bak/ w cleanlist' \ 96 -e '/.obj/ w cleanlist' \ 97 -e '/.exe/ w cleanlist' \ 98 -e '/.aux/ w cleanlist' \ 99 -e '/.blg/ w cleanlist' \ 100 -e '/.dvi/ w cleanlist' \ 101 -e '/.glo/ w cleanlist' \ 102 -e '/.idx/ w cleanlist' \ 103 -e '/.ilg/ w cleanlist' \ 104 -e '/.ind/ w cleanlist' \ 105 -e '/.lof/ w cleanlist' \ 106 -e '/.log/ w cleanlist' \ 107 -e '/.lot/ w cleanlist' \ 108 -e '/.toc/ w cleanlist' \ 109 compllist 110 @rm -f `cat cleanlist` 111 @rm -f compllist 112 @rm -f cleanlist 113 114depend:; @mkmf -f $(MAKEFILE) 115 116echo:; @echo $(HDRS) $(SRCS) 117 118index:; @ctags -wx $(HDRS) $(SRCS) 119 120install: $(PROGRAM) 121 @echo Installing $(PROGRAM) in $(DEST) 122 @strip $(PROGRAM) 123 @if [ $(DEST) != . ]; then rm -f $(DEST)/$(PROGRAM); fi 124 @if [ $(DEST) != . ]; then $(INSTALL) -f $(PROGRAM) $(DEST); fi 125 126install-local: $(PROGRAM) 127 @echo Installing $(PROGRAM) in $(BINLOCAL) 128 @strip $(PROGRAM) 129 @rm -f $(BINLOCAL)/$(PROGRAM).old 130 @if [ -f $(BINLOCAL)/$(PROGRAM) ]; then \ 131 mv $(BINLOCAL)/$(PROGRAM) $(BINLOCAL)/$(PROGRAM).old; \ 132 fi 133 @$(INSTALL) -f $(PROGRAM) $(BINLOCAL) 134 @chmod 755 $(BINLOCAL)/$(PROGRAM) 135 136lint: $(LINTLIBS) $(HDRS) $(EXTHDRS) $(SRCS) 137 @$(LINT) $(LINTFLAGS) $(LINTLIBS) $(SRCS) 138 139print:; @$(PRINT) $(PRINTFLAGS) $(HDRS) $(SRCS) | $(LP) $(LPFLAGS) 140 141tags: $(HDRS) $(SRCS) 142 @ctags $(HDRS) $(SRCS) 143 144touch:; @touch $(HDRS) $(SRCS) $(MAKEFILE) 145 146update: $(DEST)/$(PROGRAM) 147 148d2u:; @d2u $(HDRS) $(SRCS) 149 150c:; @$(MAKE) -f $(MAKEFILE) clean 151cl:; @$(MAKE) -f $(MAKEFILE) clobber 152i:; @$(MAKE) -f $(MAKEFILE) install 153il:; @$(MAKE) -f $(MAKEFILE) install-local 154l:; @$(MAKE) -f $(MAKEFILE) lint 155t:; @$(MAKE) -f $(MAKEFILE) touch 156u:; @$(MAKE) -f $(MAKEFILE) update 157 158$(PROGRAM): $(OBJS) $(LIBS) $(MAKEFILE) 159 @echo "Linking $(PROGRAM) ..." 160 @$(LD) $(COMPFLAGS) $(OBJS) $(LIBS) -o $(PROGRAM) \ 161 -L$(LIBROOT) $(EXTLIBS) $(LDFLAGS) -lm 162 163$(DEST)/$(PROGRAM): $(HDRS) $(EXTHDRS) $(SRCS) $(LIBS) 164 @$(MAKE) -f $(MAKEFILE) install: 165 166.c.o:; $(CC) -I$(INCROOT) $(CFLAGS) $(COMPFLAGS) -c $< 167.p.o:; pc $(PFLAGS) $(COMPFLAGS) -c $< 168.f.o:; f77 $(FFLAGS) $(COMPFLAGS) -c $< 169### 170matropt.o: testproc.h 171testproc.o: testproc.h 172