~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/js/src/rules.mk

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- Mode: makefile -*-
 
2
 
3
# ***** BEGIN LICENSE BLOCK *****
 
4
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
5
#
 
6
# The contents of this file are subject to the Mozilla Public License Version
 
7
# 1.1 (the "License"); you may not use this file except in compliance with
 
8
# the License. You may obtain a copy of the License at
 
9
# http://www.mozilla.org/MPL/
 
10
#
 
11
# Software distributed under the License is distributed on an "AS IS" basis,
 
12
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 
13
# for the specific language governing rights and limitations under the
 
14
# License.
 
15
 
16
# The Original Code is Mozilla Communicator client code, released
 
17
# March 31, 1998.
 
18
 
19
# The Initial Developer of the Original Code is
 
20
# Netscape Communications Corporation.
 
21
# Portions created by the Initial Developer are Copyright (C) 1998-1999
 
22
# the Initial Developer. All Rights Reserved.
 
23
 
24
# Contributor(s):
 
25
#   Michael Ang <mang@subcarrier.org>
 
26
 
27
# Alternatively, the contents of this file may be used under the terms of
 
28
# either of the GNU General Public License Version 2 or later (the "GPL"),
 
29
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 
30
# in which case the provisions of the GPL or the LGPL are applicable instead
 
31
# of those above. If you wish to allow use of your version of this file only
 
32
# under the terms of either the GPL or the LGPL, and not to allow others to
 
33
# use your version of this file under the terms of the MPL, indicate your
 
34
# decision by deleting the provisions above and replace them with the notice
 
35
# and other provisions required by the GPL or the LGPL. If you do not delete
 
36
# the provisions above, a recipient may use your version of this file under
 
37
# the terms of any one of the MPL, the GPL or the LGPL.
 
38
 
39
# ***** END LICENSE BLOCK *****
 
40
 
 
41
#
 
42
# JSRef GNUmake makefile rules
 
43
#
 
44
 
 
45
ifdef USE_MSVC
 
46
LIB_OBJS  = $(addprefix $(OBJDIR)/, $(LIB_CFILES:.c=.obj))
 
47
PROG_OBJS = $(addprefix $(OBJDIR)/, $(PROG_CFILES:.c=.obj))
 
48
else
 
49
LIB_OBJS  = $(addprefix $(OBJDIR)/, $(LIB_CFILES:.c=.o))
 
50
LIB_OBJS  += $(addprefix $(OBJDIR)/, $(LIB_ASFILES:.s=.o))
 
51
PROG_OBJS = $(addprefix $(OBJDIR)/, $(PROG_CFILES:.c=.o))
 
52
endif
 
53
 
 
54
CFILES = $(LIB_CFILES) $(PROG_CFILES)
 
55
OBJS   = $(LIB_OBJS) $(PROG_OBJS)
 
56
 
 
57
ifdef USE_MSVC
 
58
# TARGETS = $(LIBRARY)   # $(PROGRAM) not supported for MSVC yet
 
59
TARGETS += $(SHARED_LIBRARY) $(PROGRAM)  # it is now
 
60
else
 
61
TARGETS += $(LIBRARY) $(SHARED_LIBRARY) $(PROGRAM) 
 
62
endif
 
63
 
 
64
all:
 
65
        +$(LOOP_OVER_PREDIRS) 
 
66
ifneq "$(strip $(TARGETS))" ""
 
67
        $(MAKE) -f Makefile.ref $(TARGETS)
 
68
endif
 
69
        +$(LOOP_OVER_DIRS)
 
70
 
 
71
$(OBJDIR)/%: %.c
 
72
        @$(MAKE_OBJDIR)
 
73
        $(CC) -o $@ $(CFLAGS) $*.c $(LDFLAGS)
 
74
 
 
75
# This rule must come before the rule with no dep on header
 
76
$(OBJDIR)/%.o: %.c %.h
 
77
        @$(MAKE_OBJDIR)
 
78
        $(CC) -o $@ -c $(CFLAGS) $*.c
 
79
 
 
80
 
 
81
$(OBJDIR)/%.o: %.c
 
82
        @$(MAKE_OBJDIR)
 
83
        $(CC) -o $@ -c $(CFLAGS) $*.c
 
84
 
 
85
$(OBJDIR)/%.o: %.s
 
86
        @$(MAKE_OBJDIR)
 
87
        $(AS) -o $@ $(ASFLAGS) $*.s
 
88
 
 
89
# This rule must come before rule with no dep on header
 
90
$(OBJDIR)/%.obj: %.c %.h
 
91
        @$(MAKE_OBJDIR)
 
92
        $(CC) -Fo$(OBJDIR)/ -c $(CFLAGS) $(JSDLL_CFLAGS) $*.c
 
93
 
 
94
$(OBJDIR)/%.obj: %.c
 
95
        @$(MAKE_OBJDIR)
 
96
        $(CC) -Fo$(OBJDIR)/ -c $(CFLAGS) $(JSDLL_CFLAGS) $*.c
 
97
 
 
98
$(OBJDIR)/js.obj: js.c
 
99
        @$(MAKE_OBJDIR)
 
100
        $(CC) -Fo$(OBJDIR)/ -c $(CFLAGS) $<
 
101
 
 
102
ifeq ($(OS_ARCH),OS2)
 
103
$(LIBRARY): $(LIB_OBJS)
 
104
        $(AR) $@ $? $(AR_OS2_SUFFIX)
 
105
        $(RANLIB) $@
 
106
else
 
107
ifdef USE_MSVC
 
108
$(SHARED_LIBRARY): $(LIB_OBJS)
 
109
        link.exe $(LIB_LINK_FLAGS) /base:0x61000000 $(OTHER_LIBS) \
 
110
            /out:"$@" /pdb:none\
 
111
            /implib:"$(OBJDIR)/$(@F:.dll=.lib)" $^
 
112
else
 
113
$(LIBRARY): $(LIB_OBJS)
 
114
        $(AR) rv $@ $?
 
115
        $(RANLIB) $@
 
116
 
 
117
$(SHARED_LIBRARY): $(LIB_OBJS)
 
118
        $(MKSHLIB) -o $@ $(LIB_OBJS) $(LDFLAGS) $(OTHER_LIBS)
 
119
endif
 
120
endif
 
121
 
 
122
# Java stuff
 
123
$(CLASSDIR)/$(OBJDIR)/$(JARPATH)/%.class: %.java
 
124
        mkdir -p $(@D)
 
125
        $(JAVAC) $(JAVAC_FLAGS) $<
 
126
 
 
127
define MAKE_OBJDIR
 
128
if test ! -d $(@D); then rm -rf $(@D); mkdir -p $(@D); fi
 
129
endef
 
130
 
 
131
ifdef DIRS
 
132
LOOP_OVER_DIRS          =                                       \
 
133
        @for d in $(DIRS); do                                   \
 
134
                if test -d $$d; then                            \
 
135
                        set -e;                 \
 
136
                        echo "cd $$d; $(MAKE) -f Makefile.ref $@";              \
 
137
                        cd $$d; $(MAKE) -f Makefile.ref $@; cd ..;      \
 
138
                        set +e;                                 \
 
139
                else                                            \
 
140
                        echo "Skipping non-directory $$d...";   \
 
141
                fi;                                             \
 
142
        done
 
143
endif
 
144
 
 
145
ifdef PREDIRS
 
146
LOOP_OVER_PREDIRS       =                                       \
 
147
        @for d in $(PREDIRS); do                                \
 
148
                if test -d $$d; then                            \
 
149
                        set -e;                 \
 
150
                        echo "cd $$d; $(MAKE) -f Makefile.ref $@";              \
 
151
                        cd $$d; $(MAKE) -f Makefile.ref $@; cd ..;      \
 
152
                        set +e;                                 \
 
153
                else                                            \
 
154
                        echo "Skipping non-directory $$d...";   \
 
155
                fi;                                             \
 
156
        done
 
157
endif
 
158
 
 
159
export:
 
160
        +$(LOOP_OVER_PREDIRS)   
 
161
        mkdir -p $(DIST)/include $(DIST)/$(LIBDIR) $(DIST)/bin
 
162
ifneq "$(strip $(HFILES))" ""
 
163
        $(CP) $(HFILES) $(DIST)/include
 
164
endif
 
165
ifneq "$(strip $(LIBRARY))" ""
 
166
        $(CP) $(LIBRARY) $(DIST)/$(LIBDIR)
 
167
endif
 
168
ifneq "$(strip $(JARS))" ""
 
169
        $(CP) $(JARS) $(DIST)/$(LIBDIR)
 
170
endif
 
171
ifneq "$(strip $(SHARED_LIBRARY))" ""
 
172
        $(CP) $(SHARED_LIBRARY) $(DIST)/$(LIBDIR)
 
173
endif
 
174
ifneq "$(strip $(PROGRAM))" ""
 
175
        $(CP) $(PROGRAM) $(DIST)/bin
 
176
endif
 
177
        +$(LOOP_OVER_DIRS)
 
178
 
 
179
clean:
 
180
        rm -rf $(OBJS)
 
181
        @cd fdlibm; $(MAKE) -f Makefile.ref clean
 
182
 
 
183
clobber:
 
184
        rm -rf $(OBJS) $(TARGETS) $(DEPENDENCIES)
 
185
        @cd fdlibm; $(MAKE) -f Makefile.ref clobber
 
186
 
 
187
depend:
 
188
        gcc -MM $(CFLAGS) $(LIB_CFILES)
 
189
 
 
190
tar:
 
191
        tar cvf $(TARNAME) $(TARFILES)
 
192
        gzip $(TARNAME)
 
193