[16] | 1 | CC := gcc
|
---|
| 2 | CXX := g++
|
---|
| 3 | # General setup GNU Makefile for EROS. To be included in all makefiles.
|
---|
| 4 | # Define makefile variables according to CPU
|
---|
| 5 | # MACHEROSD = `uname | sed 's/-//'` i.e. { AIX HPUX OSF1 ULTRIX }
|
---|
| 6 | #
|
---|
| 7 | # Makefile variables set are:
|
---|
[19] | 8 | # - Path to Exec, Include, Libs, Objs directories (from EROSBASEREP env. var.)
|
---|
[16] | 9 | # i.e. variables LIB, OBJ, EXE, INC
|
---|
| 10 | #---------------------------------------------------------------------------
|
---|
| 11 |
|
---|
| 12 | # define MACHEROS from uname
|
---|
| 13 | MACHEROS := $(shell echo `uname`)
|
---|
| 14 | # define the -D option
|
---|
| 15 | MACHEROSD := $(shell echo `uname | sed 's/-//'`)
|
---|
| 16 |
|
---|
| 17 | #-
|
---|
| 18 | #- Optimization option different for HP...
|
---|
| 19 | ifeq (${MACHEROS},HP-UX)
|
---|
| 20 | O := +O
|
---|
| 21 | else
|
---|
| 22 | O := -O
|
---|
| 23 | endif
|
---|
| 24 | #-
|
---|
| 25 | #- Define Makefile paths
|
---|
| 26 | #-
|
---|
| 27 | PP := ${EROSBASEREP}/${MACHEROS}/
|
---|
| 28 | LIB := ${PP}/Libs/
|
---|
| 29 | SLB := ${PP}/ShLibs/
|
---|
| 30 | OBJ := ${PP}/Objs/
|
---|
| 31 | EXE := ${PP}/Exec/
|
---|
| 32 | INC := ${EROSBASEREP}/Include/
|
---|
| 33 | CCI := ${INC}/CInc/
|
---|
| 34 | CXI := ${INC}/CxxInc/
|
---|
| 35 | #--
|
---|
| 36 |
|
---|
| 37 | #-
|
---|
| 38 | #- Define default compilation flags
|
---|
| 39 | #--
|
---|
| 40 | ifeq (${MACHEROS},HP-UX)
|
---|
| 41 | CFLAGS := -Aa
|
---|
| 42 | FFLAGS := -Aa -I${INC} -D${MACHEROSD}
|
---|
| 43 | CPPFLAGS := -I${INC} -D${MACHEROSD} \
|
---|
| 44 | -D_INCLUDE_POSIX_SOURCE -D_INCLUDE_XOPEN_SOURCE
|
---|
| 45 | else
|
---|
| 46 | FFLAGS := -I${INC} -D${MACHEROSD}
|
---|
| 47 | CPPFLAGS := -I${INC} -D${MACHEROSD}
|
---|
| 48 | endif
|
---|
| 49 | AR := ar
|
---|
| 50 | ARFLAGS := -rcs
|
---|
| 51 |
|
---|
| 52 | ifeq ($(CC), gcc)
|
---|
| 53 | CFLAGS := -g -O -Wall -Wpointer-arith \
|
---|
| 54 | -Wmissing-prototypes -Wsynth -I$(INC)
|
---|
| 55 | //CXXFLAGS := $(CFLAGS) -fno-implicit-templates -I$(CXI)
|
---|
| 56 | CXXFLAGS := $(CFLAGS) -I$(CXI)
|
---|
| 57 | endif
|
---|
| 58 |
|
---|
| 59 | #- redefine implicit rule. Les .o sont dans $(OBJ).
|
---|
| 60 | $(OBJ)%.o:%.c
|
---|
| 61 | $(COMPILE.c) -o $@ $<
|
---|
| 62 |
|
---|
| 63 | $(OBJ)%.o:%.cc
|
---|
| 64 | $(COMPILE.cc) -o $@ $<
|
---|
| 65 |
|
---|
| 66 | $(OBJ)%.o:%.f
|
---|
| 67 | $(COMPILE.f) -o $@ $<
|
---|
| 68 |
|
---|
| 69 | #OSF1
|
---|
| 70 | #LDFC est f77
|
---|
| 71 | #LDFCFLAGS est rien
|
---|
| 72 |
|
---|
| 73 | #parfois
|
---|
| 74 | #LDFC est cc
|
---|
| 75 | #LDFCFLAGS est -ltruc
|
---|
| 76 |
|
---|
| 77 | #------------------------------------------------- End of Makefile.h -------
|
---|
[18] | 78 | all : piapp piapp_nosh
|
---|
[16] | 79 |
|
---|
[18] | 80 | piapp : $(EXE)piapp $(SLB)piup.so
|
---|
[16] | 81 |
|
---|
[18] | 82 | piapp_nosh : $(EXE)piapp_nosh
|
---|
| 83 |
|
---|
[16] | 84 |
|
---|
| 85 | $(EXE)piapp : $(OBJ)pidemo.o $(SLB)libPI.so $(SLB)libOuIm.so \
|
---|
| 86 | $(SLB)liberosc.so $(SLB)libStarReco.so
|
---|
| 87 | cc -call_shared -o $(EXE)piapp $(OBJ)pidemo.o \
|
---|
| 88 | -L$(SLB) -lPI -lOuIm -lerosc -lStarReco \
|
---|
| 89 | -lgcxx -lXm -lXt -lX11 -lm
|
---|
[18] | 90 |
|
---|
| 91 | $(EXE)piapp_nosh : $(OBJ)pidemo_nosh.o $(LIB)libPI.a $(LIB)libStarReco.a \
|
---|
| 92 | $(LIB)libOutils.a $(LIB)libImages.a $(LIB)libmath.a $(LIB)libdiv.a
|
---|
| 93 | g++ -o $(EXE)piapp_nosh $(OBJ)pidemo_nosh.o \
|
---|
| 94 | -L$(LIB) -lPI -lStarReco -lImages -lOutils -lmath -ldiv \
|
---|
| 95 | -lXm -lXt -lX11 -lm
|
---|
| 96 |
|
---|
[16] | 97 | $(SLB)piup.so : $(OBJ)piup_def.o \
|
---|
| 98 | $(SLB)libOuIm.so $(SLB)liberosc.so
|
---|
| 99 | ld -shared -o $(SLB)piup.so -all $(OBJ)piup_def.o \
|
---|
| 100 | -none -L$(SLB) -lOuIm -lerosc -lgcxx -lm -lc
|
---|
| 101 |
|
---|
[18] | 102 | $(OBJ)pidemo_nosh.o: pidemo.cc pidemo.h
|
---|
| 103 | g++ -g -O -c -Wall -Wpointer-arith \
|
---|
| 104 | -Wmissing-prototypes -Wsynth -I$(INC) -I$(CXI) \
|
---|
| 105 | -D C_NO_SHLIBS -o $(OBJ)pidemo_nosh.o pidemo.cc
|
---|
[16] | 106 |
|
---|
| 107 | $(OBJ)pidemo.o: ./pidemo.cc \
|
---|
| 108 | $(INC)perrors.h \
|
---|
| 109 | $(INC)exceptions.h \
|
---|
| 110 | $(INC)defs.h \
|
---|
| 111 | $(INC)fitsimage.h \
|
---|
| 112 | $(INC)cimage.h \
|
---|
| 113 | $(INC)rzimage.h \
|
---|
| 114 | $(INC)rzvect.h \
|
---|
| 115 | $(INC)machine.h \
|
---|
| 116 | $(INC)datatypes.h \
|
---|
| 117 | $(INC)fitsheader.h \
|
---|
| 118 | $(INC)fitskeys.h pidemo.h \
|
---|
| 119 | pisysdep.h piapplx.h piapplgen.h pimsghandler.h picontainerx.h \
|
---|
| 120 | picontainergen.h piwdgx.h piwdggen.h pimenubarx.h pimenubargen.h \
|
---|
| 121 | pimenux.h pimenugen.h piwindowx.h piwindowgen.h pioptmenux.h \
|
---|
| 122 | pioptmenugen.h pistdwdgx.h pistdwdggen.h pifilechox.h pifilechogen.h \
|
---|
| 123 | piimage.h $(INC)lut.h \
|
---|
| 124 | pipixmapx.h pipixmapgen.h pibwdgx.h pibwdggen.h picmap.h picmapx.h \
|
---|
| 125 | picmapgen.h pihisto.h piscdrawwdg.h \
|
---|
| 126 | $(INC)histos.h \
|
---|
| 127 | $(INC)peida.h \
|
---|
| 128 | $(INC)utils.h pidrawwin.h \
|
---|
| 129 | $(INC)piup.h
|
---|
| 130 | $(OBJ)piup_def.o: piup_def.cc piup.h \
|
---|
| 131 | $(INC)perrors.h \
|
---|
| 132 | $(INC)exceptions.h \
|
---|
| 133 | $(INC)defs.h \
|
---|
| 134 | $(INC)fitsimage.h \
|
---|
| 135 | $(INC)cimage.h \
|
---|
| 136 | $(INC)rzimage.h \
|
---|
| 137 | $(INC)rzvect.h \
|
---|
| 138 | $(INC)machine.h \
|
---|
| 139 | $(INC)datatypes.h \
|
---|
| 140 | $(INC)fitsheader.h \
|
---|
| 141 | $(INC)fitskeys.h \
|
---|
| 142 | $(INC)utils.h $(INC)peida.h
|
---|
| 143 |
|
---|