source: Sophya/trunk/Poubelle/DPC:FitsIOServer/Mgr/mkmfprog@ 658

Last change on this file since 658 was 658, checked in by ansari, 26 years ago

no message

File size: 2.8 KB
Line 
1#!/bin/csh
2# $Id: mkmfprog,v 1.1.1.1 1999-11-26 16:37:08 ansari Exp $
3
4# $1 : nom du repertoire
5# dans le repertoire, programs : liste des programs
6# usedlibs : liste des -L -l utilises
7# usedslibs : idem pour shlibs
8
9cd ../$1
10
11rm -f GNUmakefile
12
13
14echo 'MODULECXXREPNAME := ' $1 >> GNUmakefile
15# 04/98 : le fichier X11/Xlib.h contient des declarations de fonctions sans type
16# Cela genere un grand nombre de warning avec cxx V6
17# On specifie donc -msg_quiet pour ProgPI
18if ($1 == 'ProgPI') then
19 echo 'MODULEDECCXXFLAGS := -msg_quiet' >> GNUmakefile
20endif
21echo 'include ../Mgr/Makefile.h' >> GNUmakefile
22
23echo ' ' >> GNUmakefile
24
25echo 'ifdef NOSHLIB' >> GNUmakefile
26echo 'LIBF = ' `sed -e 's/.*/$(LIB)lib&.a/' usedlibs` >> GNUmakefile
27echo 'LIBS = -L$(LIB)' `sed -e 's/.*/-l&/' usedlibs` ' -lm' >> GNUmakefile
28echo 'ifeq ($(CXX),cxx)' >> GNUmakefile
29echo '# librairie des instances de templates cxx' >> GNUmakefile
30echo 'LIBS := $(LIBS) -lertcxx' >> GNUmakefile
31echo 'endif' >> GNUmakefile
32echo 'else' >> GNUmakefile
33echo 'LIBF = ' `sed -e 's/.*/$(SLB)lib&.so/' usedslibs` >> GNUmakefile
34echo 'LIBS = -L$(SLB)' `sed -e 's/.*/-l&/' usedslibs` ' -lm'>> GNUmakefile
35echo 'endif' >> GNUmakefile
36
37echo 'LIBSORA := $(LIBS)' >> GNUmakefile
38echo 'ifdef ORACLE_HOME' >> GNUmakefile
39echo 'LIBSORA := -L$(LIB) -lDb++ $(LIBS) -lErosDb -L$(ORACLE_HOME)/lib -lclntsh' >> GNUmakefile
40echo 'endif' >> GNUmakefile
41
42echo 'LDLIBS := $(LIBS) $(LDLIBS)' >> GNUmakefile
43
44set progaexe = programs
45if( -e programs_exe ) set progaexe = programs_exe
46echo 'PROGS = '`cut -d \ -f1 $progaexe | awk '{if(length($1)>0) print $1}' | sed -e 's/^/\$(EXE)/'` >> GNUmakefile
47unset progaexe
48
49echo " " >> GNUmakefile
50echo 'all: $(PROGS)' >> GNUmakefile
51
52set cxxrepname = cxxrep_$1
53
54cat >> GNUmakefile << __END__
55
56clean:
57 rm -f \$(PROGS)
58 if [ -d \$(OBJ)$cxxrepname ] ; then cd \$(OBJ)$cxxrepname ; rm -f *.o ; fi
59
60__END__
61
62awk -f ../Mgr/mkmfprog.awk programs >> GNUmakefile
63
64#foreach f (`cat programs`)
65# echo $f ': $(EXE)'$f >> GNUmakefile
66# echo ' ' >> GNUmakefile
67# echo '$(EXE)'$f ':' '$(OBJ)'$f.o '$(LIBF)' >> GNUmakefile
68# echo ' g++ $(LDFLAGS) -o $@ $< $(LIBS)' >> GNUmakefile
69# echo " ">> GNUmakefile
70#end
71
72#foreach f (`cat ../Mgr/programs_db`)
73# echo $f ': $(EXE)'$f >> GNUmakefile
74# echo ' ' >> GNUmakefile
75# echo '$(EXE)'$f ':' '$(OBJ)'$f.o '$(LIBF)' >> GNUmakefile
76# echo ' g++ $(LDFLAGS) -o $@ $< $(LIBSORA)' >> GNUmakefile
77# echo " ">> GNUmakefile
78#end
79
80set inc = $DPCDEVREP/Include
81
82
83foreach f ( *.cc )
84 gcc -MM -I$inc $f \
85 | sed -e 's/.*\.o/\$(OBJ)&/' \
86 | sed -e 's?'$inc/'?$(INC)?g' >> GNUmakefile
87end
88
89
90
91
Note: See TracBrowser for help on using the repository browser.