xref: /trunk/main/solenv/inc/tg_lib.mk (revision 7871dc3ea494bf86c742e1f4dfc9c6e20f5bcb2a)
1*7871dc3eSAndrew Rist#**************************************************************
2cdf0e10cSrcweir#
3*7871dc3eSAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
4*7871dc3eSAndrew Rist#  or more contributor license agreements.  See the NOTICE file
5*7871dc3eSAndrew Rist#  distributed with this work for additional information
6*7871dc3eSAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
7*7871dc3eSAndrew Rist#  to you under the Apache License, Version 2.0 (the
8*7871dc3eSAndrew Rist#  "License"); you may not use this file except in compliance
9*7871dc3eSAndrew Rist#  with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir#
11*7871dc3eSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir#
13*7871dc3eSAndrew Rist#  Unless required by applicable law or agreed to in writing,
14*7871dc3eSAndrew Rist#  software distributed under the License is distributed on an
15*7871dc3eSAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*7871dc3eSAndrew Rist#  KIND, either express or implied.  See the License for the
17*7871dc3eSAndrew Rist#  specific language governing permissions and limitations
18*7871dc3eSAndrew Rist#  under the License.
19cdf0e10cSrcweir#
20*7871dc3eSAndrew Rist#**************************************************************
21*7871dc3eSAndrew Rist
22*7871dc3eSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir#######################################################
25cdf0e10cSrcweir# Anweisungen fuer das Linken
26cdf0e10cSrcweir# unroll begin
27cdf0e10cSrcweir
28cdf0e10cSrcweir.IF "$(LIB$(TNR)TARGET)" != ""
29cdf0e10cSrcweir.IF "$(LIB$(TNR)ARCHIV)" != ""
30cdf0e10cSrcweir
31cdf0e10cSrcweir$(LIB$(TNR)ARCHIV) :    $(LIB$(TNR)TARGET)
32cdf0e10cSrcweir    @echo "Making:   " $(@:f)
33cdf0e10cSrcweir    @@-$(RM) $@
34cdf0e10cSrcweir.IF "$(GUI)"=="UNX"
35cdf0e10cSrcweir    @-$(RM) $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
36cdf0e10cSrcweir.IF "$(OS)" =="HPUX_FRAG_HR"
37cdf0e10cSrcweir    @-$(RM) $(MISC)/$(LIB$(TNR)ARCHIV:b)_closetempl.cmd
38cdf0e10cSrcweir    @echo $(LINK) +inst_close -c `cat $(LIB$(TNR)TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(MISC)/$(LIB$(TNR)ARCHIV:b)_closetempl.cmd
39cdf0e10cSrcweir    @cat $(MISC)/$(LIB$(TNR)ARCHIV:b)_closetempl.cmd
40cdf0e10cSrcweir    @+source $(MISC)/$(LIB$(TNR)ARCHIV:b)_closetempl.cmd
41cdf0e10cSrcweir.ENDIF
42cdf0e10cSrcweir    @echo $(LIBMGR) $(LIB$(TNR)FLAGS) $(LIBFLAGS) $(LIB$(TNR)ARCHIV) `cat $(LIB$(TNR)TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
43cdf0e10cSrcweir.IF "$(OS)$(COM)"=="NETBSDGCC"
44cdf0e10cSrcweir    @echo  ranlib $(LIB$(TNR)ARCHIV) >> $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
45cdf0e10cSrcweir.ENDIF
46cdf0e10cSrcweir.IF "$(OS)" == "MACOSX"
47cdf0e10cSrcweir    @echo  ranlib $(LIB$(TNR)ARCHIV) >> $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
48cdf0e10cSrcweir.ENDIF
49cdf0e10cSrcweir.IF "$(VERBOSE)" == "TRUE"
50cdf0e10cSrcweir    @cat $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
51cdf0e10cSrcweir.ENDIF
52cdf0e10cSrcweir    @+source $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
53cdf0e10cSrcweir.ELSE           # "$(GUI)"=="UNX"
54cdf0e10cSrcweir.IF "$(GUI)$(COM)"=="WNTGCC"
55cdf0e10cSrcweir    @+-$(RM) $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
56cdf0e10cSrcweir    @+echo $(LIBMGR) $(LIB$(TNR)FLAGS) $(LIBFLAGS) $(LIB$(TNR)ARCHIV) `cat $(LIB$(TNR)TARGET) | sed s#'^'$(ROUT)#$(PRJ)/$(ROUT)#g` > $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
57cdf0e10cSrcweir    @+echo  ranlib $(LIB$(TNR)ARCHIV) >> $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
58cdf0e10cSrcweir.IF "$(VERBOSE)" == "TRUE"
59cdf0e10cSrcweir    @cat $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
60cdf0e10cSrcweir.ENDIF
61cdf0e10cSrcweir    @+source $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
62cdf0e10cSrcweir.ELSE
63cdf0e10cSrcweir    @echo just a dummy > $@
64cdf0e10cSrcweir.ENDIF          # "$(GUI)$(COM)"=="WNTGCC"
65cdf0e10cSrcweir.ENDIF          # "$(GUI)"=="UNX"
66cdf0e10cSrcweir
67cdf0e10cSrcweir.ENDIF          # "$(LIB$(TNR)ARCHIV)" != ""
68cdf0e10cSrcweir
69cdf0e10cSrcweir$(LIB$(TNR)TARGET) :    $(LIB$(TNR)FILES) \
70cdf0e10cSrcweir                        $(LIB$(TNR)OBJFILES) \
71cdf0e10cSrcweir                        $(LIB$(TNR)DEPN)
72cdf0e10cSrcweir.IF "$(VERBOSE)" == "TRUE"
73cdf0e10cSrcweir    @echo ------------------------------
74cdf0e10cSrcweir    @echo using: $(LIB$(TNR)FILES)
75cdf0e10cSrcweir    @echo using: $(LIB$(TNR)TARGET)
76cdf0e10cSrcweir    @echo ------------------------------
77cdf0e10cSrcweir.ENDIF
78cdf0e10cSrcweir    @echo "Making:   " $(@:f)
79cdf0e10cSrcweir    @@-$(RM) $@
80cdf0e10cSrcweir.IF "$(GUI)"=="UNX"
81cdf0e10cSrcweir    @echo $(LIB$(TNR)OBJFILES:s/.obj/.o/) | sed "s#$(PRJ:s/./\./)/$(ROUT)#$(ROUT)#g" | xargs -n 1 > $@
82cdf0e10cSrcweir    @cat /dev/null $(LIB$(TNR)FILES:s/.obj/.o/) | xargs -n 1 >> $@
83cdf0e10cSrcweir    @$(RM) $(@:d)$(@:b).dump
84cdf0e10cSrcweir.IF "$(OS)"=="MACOSX"
85cdf0e10cSrcweir    @-nm `cat $(LIB$(TNR)TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
86cdf0e10cSrcweir.ELSE
87cdf0e10cSrcweir    @nm `cat $(LIB$(TNR)TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
88cdf0e10cSrcweir.ENDIF
89cdf0e10cSrcweir
90cdf0e10cSrcweir.ELIF "$(GUI)"=="OS2"
91cdf0e10cSrcweir    $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) $@ $(LIB$(TNR)FILES) $(LIB$(TNR)OBJFILES)
92cdf0e10cSrcweir    @+-$(RM) $(@:s/.lib/.lin/)
93cdf0e10cSrcweir.IF "$(LIB$(TNR)OBJFILES)"!=""
94cdf0e10cSrcweir    @+$(TYPE) $(mktmp $(LIB$(TNR)OBJFILES)) > $(null,$(LIB$(TNR)OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
95cdf0e10cSrcweir.ENDIF          # "$(LIB$(TNR)OBJFILES)"!=""
96cdf0e10cSrcweir.IF "$(LIB$(TNR)FILES)"!=""
97cdf0e10cSrcweir    @-$(TYPE) $(foreach,i,$(LIB$(TNR)FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
98cdf0e10cSrcweir.ENDIF          # "$(LIB$(TNR)FILES)"!=""
99cdf0e10cSrcweir    @+$(ECHONL)
100cdf0e10cSrcweir
101cdf0e10cSrcweir.ELSE           # "$(GUI)"=="UNX"
102cdf0e10cSrcweir.IF "$(GUI)"=="WNT"
103cdf0e10cSrcweir.IF "$(COM)"=="GCC"
104cdf0e10cSrcweir    +$(ECHONL) $(LIB$(TNR)OBJFILES) | sed "s#$(PRJ:s/././)/$(ROUT)#$(ROUT)#g" | xargs -n1 > $@
105cdf0e10cSrcweir    @+cat /dev/null $(LIB$(TNR)FILES) | xargs -n1 >> $@
106cdf0e10cSrcweir.ELSE
107cdf0e10cSrcweir    $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) /OUT:$@ @$(mktmp $(LIB$(TNR)FILES) $(LIB$(TNR)OBJFILES))
108cdf0e10cSrcweir    @-$(RM) $(@:s/.lib/.lin/)
109cdf0e10cSrcweir.IF "$(LIB$(TNR)OBJFILES)"!=""
110cdf0e10cSrcweir    @$(TYPE) $(mktmp $(LIB$(TNR)OBJFILES)) > $(null,$(LIB$(TNR)OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
111cdf0e10cSrcweir.ENDIF          # "$(LIB$(TNR)OBJFILES)"!=""
112cdf0e10cSrcweir.IF "$(LIB$(TNR)FILES)"!=""
113cdf0e10cSrcweir    @-$(TYPE) $(foreach,i,$(LIB$(TNR)FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
114cdf0e10cSrcweir.ENDIF          # "$(LIB$(TNR)FILES)"!=""
115cdf0e10cSrcweir    @$(ECHONL)
116cdf0e10cSrcweir.ENDIF          # "$(LIB$(TNR)FILES)"!=""
117cdf0e10cSrcweir.ELSE           # "$(GUI)"=="WNT"
118cdf0e10cSrcweir    @-$(RM) $@
119cdf0e10cSrcweir  .IF "$(VERBOSE)" == "TRUE"
120cdf0e10cSrcweir    @echo $(LIBMGR) r $@ $(LIB$(TNR)OBJFILES)
121cdf0e10cSrcweir  .ENDIF
122cdf0e10cSrcweir    $(COMMAND_ECHO)$(LIBMGR) r $@ $(LIB$(TNR)OBJFILES) $(LIB$(TNR)FILES) bla.lib
123cdf0e10cSrcweir.ENDIF          # "$(GUI)"=="WNT"
124cdf0e10cSrcweir.ENDIF          # "$(GUI)"=="UNX"
125cdf0e10cSrcweir.ENDIF          # "$(LIB$(TNR)TARGET)" != ""
126cdf0e10cSrcweir
127cdf0e10cSrcweir# Anweisungen fuer das LIBTARGETs
128cdf0e10cSrcweir# unroll end
129cdf0e10cSrcweir#######################################################
130cdf0e10cSrcweir
131