| 1 |
################################################################# |
| 2 |
# Makefile for HP aCC c++ programs SAR tools # |
| 3 |
# should work with other compilers as well # |
| 4 |
# "make [all]" all exe's # |
| 5 |
# "make prog.o" compile only prog.o # |
| 6 |
# "make prog" compile only prog # |
| 7 |
# "make clean" remove junk caused by makes # |
| 8 |
# "make cleaner" remove all caused by makes # |
| 9 |
# "make uninstall" remove all caused by makes (incl. inst) # |
| 10 |
# "make install" installs executables in INSTALL_DIR # |
| 11 |
# (or if it's me, in CB_INSTALL # |
| 12 |
# also installs gmt scripts. # |
| 13 |
# # |
| 14 |
#%// Bert Kampes 27-Dec-2000 # |
| 15 |
### RCS # |
| 16 |
# $Header: /users/kampes/DEVELOP/DORIS/SARtools/RCS/Makefile, # |
| 17 |
# v 3.8 2004/08/06 15:41:24 kampes Exp $ # |
| 18 |
#%// TUDelft 16-Apr-2009 # |
| 19 |
################################################################# |
| 20 |
|
| 21 |
### The shell we're using ### |
| 22 |
SHELL = /bin/sh |
| 23 |
|
| 24 |
### Installdirdef should exist! |
| 25 |
#INSTALL_DIR = /usr/local/bin |
| 26 |
INSTALL_DIR = /home/dlevelt/src/Doris_s1_git/bin |
| 27 |
|
| 28 |
### GCC compiler |
| •29 |
#CC = g++ |
| 30 |
CFLAGS += -O3 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE #-m32 to force 32bit on 64bit platform |
| 31 |
|
| 32 |
### Intel compiler |
| 33 |
#CC = icpc |
| 34 |
#CFLAGS = -Wp64 # -fast -O3 -parallel -auto-ilp32 -pc32 |
| 35 |
|
| 36 |
################################################################## |
| 37 |
### THERE SHOULD BE NOTHING YOU WANT TO CHANGE BELOW THIS LINE ### |
| 38 |
################################################################## |
| 39 |
### Only for me, this will be ignored... |
| 40 |
CB_INSTALL = ../../executables/64bit |
| 41 |
|
| 42 |
### The programs we want |
| 43 |
PROGS = wrap \ |
| 44 |
bkconvert \ |
| 45 |
cpxmult \ |
| 46 |
cpxdiv \ |
| 47 |
cpxconj \ |
| 48 |
flapjack \ |
| 49 |
cpxfiddle \ |
| 50 |
floatmult \ |
| 51 |
floatmask \ |
| 52 |
readrasterheader \ |
| 53 |
rasterheader \ |
| 54 |
dateconv |
| 55 |
|
| 56 |
# usedin install: |
| 57 |
SCRIPTS = |
| 58 |
#SCRIPTS = cpx2ps \ |
| 59 |
# philamh2ps |
| 60 |
|
| 61 |
### Compilation |
| 62 |
default: all |
| 63 |
all: $(PROGS) dummy |
| 64 |
|
| 65 |
# dummy, since else makefile want to recompile the last util. |
| 66 |
dummy: |
| 67 |
|
| 68 |
# the utilities. |
| 69 |
bkconvert: bkconvert.o |
| •70 |
$(CXX) $(CFLAGS) $(LDFLAGS) [email protected] -o $@ |
| 71 |
wrap: wrap.o |
| •72 |
$(CXX) $(CFLAGS) $(LDFLAGS) [email protected] -o $@ |
| 73 |
cpxmult: cpxmult.o |
| •74 |
$(CXX) $(CFLAGS) $(LDFLAGS) [email protected] -o $@ |
| 75 |
cpxdiv: cpxdiv.o |
| •76 |
$(CXX) $(CFLAGS) $(LDFLAGS) [email protected] -o $@ |
| 77 |
cpxconj: cpxconj.o |
| •78 |
$(CXX) $(CFLAGS) $(LDFLAGS) [email protected] -o $@ |
| 79 |
cpxfiddle: cpxfiddle.o |
| •80 |
$(CXX) $(CFLAGS) $(LDFLAGS) [email protected] -o $@ |
| 81 |
flapjack: flapjack.o |
| •82 |
$(CXX) $(CFLAGS) $(LDFLAGS) [email protected] -o $@ |
| 83 |
floatmask: floatmask.o |
| •84 |
$(CXX) $(CFLAGS) $(LDFLAGS) [email protected] -o $@ |
| 85 |
floatmult: floatmult.o |
| •86 |
$(CXX) $(CFLAGS) $(LDFLAGS) [email protected] -o $@ |
| 87 |
readrasterheader: readrasterheader.o |
| •88 |
$(CXX) $(CFLAGS) $(LDFLAGS) [email protected] -o $@ |
| 89 |
rasterheader: rasterheader.o |
| •90 |
$(CXX) $(CFLAGS) $(LDFLAGS) [email protected] -o $@ |
| 91 |
dateconv: dateconv.o |
| •92 |
$(CXX) $(CFLAGS) $(LDFLAGS) [email protected] -o $@ |
| 93 |
|
| 94 |
|
| 95 |
### Install in CB_INSTALL by linking/copying executables ### |
| 96 |
install: $(PROGS) |
| 97 |
dir=$(CB_INSTALL); \ |
| 98 |
if test -d $$dir; then \ |
| 99 |
$(MAKE) cbinstall; else $(MAKE) definstall; fi; |
| 100 |
|
| 101 |
# or use ln instead of cp |
| 102 |
# ln -sf `pwd`/$$p $(CB_INSTALL)/$$p; \ |
| 103 |
|
| 104 |
### Use symbolic links at our system, copy to /usr/local/bin on other. |
| 105 |
definstall: $(PROGS) |
| •106 |
mkdir -p $(INSTALL_DIR) |
| 107 |
list='$(PROGS) $(SCRIPTS)'; for p in $$list; do \ |
| 108 |
echo "Installing (copy): $$p"; \ |
| 109 |
cp -f $$p $(INSTALL_DIR)/$$p; \ |
| 110 |
done |
| 111 |
|
| 112 |
### Use symbolic links at our system, copy to /usr/local/bin on other. |
| 113 |
cbinstall: |
| 114 |
dir=$(CB_INSTALL); \ |
| 115 |
if test ! -d $$dir; then \ |
| 116 |
echo "Sorry, dir $(CB_INSTALL) does not exist, exiting..."; exit; fi; \ |
| 117 |
echo Installing in directory: $$dir; \ |
| 118 |
list='$(PROGS) $(SCRIPTS)'; for p in $$list; do \ |
| 119 |
echo "Installing (copy): $$p"; \ |
| 120 |
cp -f $$p $(CB_INSTALL)/$$p; \ |
| 121 |
done |
| 122 |
$(MAKE) cleaner |
| 123 |
|
| 124 |
lninstall: |
| 125 |
dir=$(CB_INSTALL); \ |
| 126 |
if test ! -d $$dir; then \ |
| 127 |
echo "Sorry, you are not me, exiting..."; exit; fi; \ |
| 128 |
echo Installing in directory: $$dir; \ |
| 129 |
list='$(PROGS) $(SCRIPTS)'; for p in $$list; do \ |
| 130 |
echo "Installing (link): $$p"; \ |
| 131 |
cp -f `pwd`/$$p $(CB_INSTALL)/$$p; \ |
| 132 |
done |
| 133 |
#ln -sf `pwd`/$$p $(CB_INSTALL)/$$p; \ |
| 134 |
$(MAKE) cleaner |
| 135 |
|
| 136 |
### Helpers ### |
| 137 |
clean: |
| 138 |
@rm -f *.o *dummy* *.bak |
| 139 |
@echo "* Removed junk." |
| 140 |
### some reason under cygwin progs are not removed without ".exe"??? |
| 141 |
CYGWIN_EXE = $(PROGS:=.exe) |
| 142 |
cleaner: clean |
| 143 |
@rm -f $(PROGS) $(CYGWIN_EXE) a.out |
| 144 |
@echo "* Removed executables in source dir: `pwd`." |
| 145 |
uninstall: cleaner |
| 146 |
dir=$(CB_INSTALL); \ |
| 147 |
if test -d $$dir; then \ |
| 148 |
cd $(CB_INSTALL); rm -f $(PROGS); \ |
| 149 |
echo "* Removed executables in install dir: $(CB_INSTALL)."; fi; |
| 150 |
dir=$(INSTALL_DIR); \ |
| 151 |
if test -d $$dir; then \ |
| 152 |
cd $(INSTALL_DIR); rm -f $(PROGS) $(CYGWIN_EXE); \ |
| 153 |
echo "* Removed executables in install dir: $(INSTALL_DIR)."; fi; |
| 154 |
|
| 155 |
### How to make object files ### |
| •156 |
.cc.o: |
| 157 |
$(CXX) $(CPPFLAGS) $(CFLAGS) -c -o $(@) $< |
| 158 |
|
| 159 |
### EOF. |
| 160 |
|