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