xref: /aoo42x/main/solenv/inc/tg_lib.mk (revision 7871dc3e)
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.ELSE			# "$(GUI)"=="UNX"
54.IF "$(GUI)$(COM)"=="WNTGCC"
55	@+-$(RM) $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
56	@+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
57	@+echo  ranlib $(LIB$(TNR)ARCHIV) >> $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
58.IF "$(VERBOSE)" == "TRUE"
59	@cat $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
60.ENDIF
61	@+source $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
62.ELSE
63	@echo just a dummy > $@
64.ENDIF			# "$(GUI)$(COM)"=="WNTGCC"
65.ENDIF			# "$(GUI)"=="UNX"
66
67.ENDIF			# "$(LIB$(TNR)ARCHIV)" != ""
68
69$(LIB$(TNR)TARGET) :	$(LIB$(TNR)FILES) \
70						$(LIB$(TNR)OBJFILES) \
71						$(LIB$(TNR)DEPN)
72.IF "$(VERBOSE)" == "TRUE"
73	@echo ------------------------------
74	@echo using: $(LIB$(TNR)FILES)
75	@echo using: $(LIB$(TNR)TARGET)
76	@echo ------------------------------
77.ENDIF
78	@echo "Making:   " $(@:f)
79	@@-$(RM) $@
80.IF "$(GUI)"=="UNX"
81	@echo $(LIB$(TNR)OBJFILES:s/.obj/.o/) | sed "s#$(PRJ:s/./\./)/$(ROUT)#$(ROUT)#g" | xargs -n 1 > $@
82	@cat /dev/null $(LIB$(TNR)FILES:s/.obj/.o/) | xargs -n 1 >> $@
83	@$(RM) $(@:d)$(@:b).dump
84.IF "$(OS)"=="MACOSX"
85	@-nm `cat $(LIB$(TNR)TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
86.ELSE
87	@nm `cat $(LIB$(TNR)TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
88.ENDIF
89
90.ELIF "$(GUI)"=="OS2"
91	$(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) $@ $(LIB$(TNR)FILES) $(LIB$(TNR)OBJFILES)
92	@+-$(RM) $(@:s/.lib/.lin/)
93.IF "$(LIB$(TNR)OBJFILES)"!=""
94	@+$(TYPE) $(mktmp $(LIB$(TNR)OBJFILES)) > $(null,$(LIB$(TNR)OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
95.ENDIF          # "$(LIB$(TNR)OBJFILES)"!=""
96.IF "$(LIB$(TNR)FILES)"!=""
97	@-$(TYPE) $(foreach,i,$(LIB$(TNR)FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
98.ENDIF          # "$(LIB$(TNR)FILES)"!=""
99	@+$(ECHONL)
100
101.ELSE			# "$(GUI)"=="UNX"
102.IF "$(GUI)"=="WNT"
103.IF "$(COM)"=="GCC"
104	+$(ECHONL) $(LIB$(TNR)OBJFILES) | sed "s#$(PRJ:s/././)/$(ROUT)#$(ROUT)#g" | xargs -n1 > $@
105	@+cat /dev/null $(LIB$(TNR)FILES) | xargs -n1 >> $@
106.ELSE
107	$(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) /OUT:$@ @$(mktmp $(LIB$(TNR)FILES) $(LIB$(TNR)OBJFILES))
108    @-$(RM) $(@:s/.lib/.lin/)
109.IF "$(LIB$(TNR)OBJFILES)"!=""
110	@$(TYPE) $(mktmp $(LIB$(TNR)OBJFILES)) > $(null,$(LIB$(TNR)OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
111.ENDIF          # "$(LIB$(TNR)OBJFILES)"!=""
112.IF "$(LIB$(TNR)FILES)"!=""
113	@-$(TYPE) $(foreach,i,$(LIB$(TNR)FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
114.ENDIF          # "$(LIB$(TNR)FILES)"!=""
115	@$(ECHONL)
116.ENDIF          # "$(LIB$(TNR)FILES)"!=""
117.ELSE			# "$(GUI)"=="WNT"
118	@-$(RM) $@
119  .IF "$(VERBOSE)" == "TRUE"
120	@echo $(LIBMGR) r $@ $(LIB$(TNR)OBJFILES)
121  .ENDIF
122	$(COMMAND_ECHO)$(LIBMGR) r $@ $(LIB$(TNR)OBJFILES) $(LIB$(TNR)FILES) bla.lib
123.ENDIF          # "$(GUI)"=="WNT"
124.ENDIF          # "$(GUI)"=="UNX"
125.ENDIF          # "$(LIB$(TNR)TARGET)" != ""
126
127# Anweisungen fuer das LIBTARGETs
128# unroll end
129#######################################################
130
131