Put rtl8168.device in SYS:Storage/Networks dir since rtl8169.device covers a
[AROS.git] / external / openurl / raPrefs / Makefile
blobc8da6a85a6ac22179411150958e3401aa5e460f8
1 #/***************************************************************************
3 # openurl.library - universal URL display and browser launcher library
4 # Copyright (C) 1998-2005 by Troels Walsted Hansen, et al.
5 # Copyright (C) 2005-2009 by openurl.library Open Source Team
7 # This library is free software; it has been placed in the public domain
8 # and you can freely redistribute it and/or modify it. Please note, however,
9 # that some components may be under the LGPL or GPL license.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 # openurl.library project: http://sourceforge.net/projects/openurllib/
17 # $Id$
19 #***************************************************************************/
21 ###########################################################################
22 # This makefile is a very generic one. It tries to identify both, the host
23 # and the target operating system for which YAM should be compiled.
24 # However, this auto-detection can be easily overridden by directly
25 # specifying an option on the commandline while calling 'make'.
27 # Example:
29 # # to explicitly compile for AmigaOS3
30 # > make OS=os3
32 # # to compile for AmigaOS4 but without debugging
33 # > make OS=os4 DEBUG=
36 #############################################
37 # find out the HOST operating system
38 # on which this makefile is run
39 HOST ?= $(shell uname)
40 ifeq ($(HOST), AmigaOS)
41 ifeq ($(shell uname -m), powerpc)
42 HOST = AmigaOS4
43 endif
44 ifeq ($(shell uname -m), ppc)
45 HOST = AmigaOS4
46 endif
47 endif
49 # if no host is identifed (no uname tool)
50 # we assume a AmigaOS build
51 ifeq ($(HOST),)
52 HOST = AmigaOS
53 endif
55 #############################################
56 # now we find out the target OS for
57 # which we are going to compile YAM in case
58 # the caller didn't yet define OS himself
59 ifndef (OS)
60 ifeq ($(HOST), AmigaOS4)
61 OS = os4
62 else
63 ifeq ($(HOST), AmigaOS)
64 OS = os3
65 else
66 ifeq ($(HOST), MorphOS)
67 OS = mos
68 else
69 ifeq ($(HOST), AROS)
70 # now we find out which CPU system aros will be used
71 ifeq ($(shell uname -m), powerpc)
72 OS = aros-ppc
73 endif
74 ifeq ($(shell uname -m), ppc)
75 OS = aros-ppc
76 endif
77 ifeq ($(shell uname -m), i386)
78 OS = aros-i386
79 endif
80 ifeq ($(shell uname -m), i686)
81 OS = aros-i686
82 endif
83 ifeq ($(shell uname -m), x86_64)
84 OS = aros-x86_64
85 endif
86 else
87 OS = os4
88 endif
89 endif
90 endif
91 endif
92 endif
94 #############################################
95 # define common commands we use in this
96 # makefile. Please note that each of them
97 # might be overridden on the commandline.
99 # common commands
100 FLEX = flex
101 FC = flexcat
102 EXPR = expr
103 DATE = date
104 RM = delete force
105 RMDIR = delete force all
106 MKDIR = makedir
107 CHMOD = protect FLAGS=rwed
108 SED = sed
109 CP = copy
110 CC = gcc
111 STRIP = strip
112 OBJDUMP = objdump
114 # path definitions
115 CDUP = /
116 CDTHIS=
118 # override some variables for non-native builds (cross-compiler)
119 ifneq ($(HOST), AmigaOS)
120 ifneq ($(HOST), AmigaOS4)
121 ifneq ($(HOST), MorphOS)
123 # when we end up here this is either a unix or Aros host
124 # so lets use unix kind of commands
125 RM = rm -f
126 RMDIR = rm -rf
127 MKDIR = mkdir -p
128 CHMOD = chmod 755
129 CP = cp -f
131 CDUP = ../
132 CDTHIS= ./
134 endif
135 endif
136 endif
138 ###########################################################################
139 # CPU and DEBUG can be defined outside, defaults to above
140 # using e.g. "make DEBUG= CPU=-mcpu=603e" produces optimized non-debug
141 # PPC-603e version
143 # OPTFLAGS are disabled by DEBUG normally!
145 # ignored warnings are:
146 # none - because we want to compile with -Wall all the time
148 # Common Directories
149 PREFIX = $(CDTHIS)
150 OBJDIR = .obj_$(OS)
151 BINDIR = bin_$(OS)
152 LOCALE = ../locale
153 VPATH = $(OBJDIR)
154 DEPFILE = Makefile.dep
156 # target definition
157 TARGET = $(BINDIR)/OpenURL
159 # Common compiler/linker flags
160 WARN = -W -Wall -Wwrite-strings -Wpointer-arith -Wsign-compare
161 OPTFLAGS = -O3 -fomit-frame-pointer
162 DEBUG = -DDEBUG -O0
163 DEBUGSYM = -g -gstabs
164 CFLAGS = -I. -I../include $(CPU) $(WARN) $(OPTFLAGS) $(DEBUG) $(DEBUGSYM) $(USER_CFLAGS)
165 LDFLAGS = $(CPU) $(DEBUGSYM)
166 LDLIBS =
168 # different options per target OS
169 ifeq ($(OS), os4)
171 ##############################
172 # AmigaOS4
174 # Compiler/link/strip commands
175 ifneq ($(HOST), AmigaOS4)
176 CC = ppc-amigaos-gcc
177 STRIP = ppc-amigaos-strip
178 OBJDUMP = ppc-amigaos-objdump
179 endif
181 # Compiler/Linker flags
182 CRT = newlib
183 CPU = -mcpu=powerpc
184 WARN += -Wdeclaration-after-statement -Wdisabled-optimization
185 REDEFINE =
186 CFLAGS += -mcrt=$(CRT) -D__NEW_TIMEVAL_DEFINITION_USED__ \
187 $(REDEFINE) -Wa,-mregnames
188 LDFLAGS += -mcrt=$(CRT)
189 LDLIBS += -lraauto -lauto
191 else
192 ifeq ($(OS), os3)
194 ##############################
195 # AmigaOS3
197 # Compiler/link/strip commands
198 ifneq ($(HOST), AmigaOS)
199 CC = m68k-amigaos-gcc
200 STRIP = m68k-amigaos-strip
201 OBJDUMP = m68k-amigaos-objdump
202 endif
204 # Compiler/Linker flags
205 CPU = -m68020-60 -msoft-float
206 CFLAGS += -noixemul -DNO_INLINE_STDARG
207 LDFLAGS += -noixemul
208 LDLIBS += -ldebug -lmui
210 # we empty the TARGET because we don't support
211 # this platform yet
212 TARGET=
214 else
215 ifeq ($(OS), mos)
217 ##############################
218 # MorphOS
220 # Compiler/link/strip commands
221 ifneq ($(HOST), MorphOS)
222 CC = ppc-morphos-gcc
223 STRIP = ppc-morphos-strip
224 OBJDUMP = ppc-morphos-objdump
225 endif
227 # Compiler/Linker flags
228 CPU = -mcpu=powerpc
229 CFLAGS += -noixemul
230 LDFLAGS += -noixemul
231 LDLIBS += -ldebug -mui
233 # we empty the TARGET because we don't support
234 # this platform yet
235 TARGET=
237 else
238 ifeq ($(OS), aros-i386)
240 ##############################
241 # AROS (i386)
243 ifneq ($(HOST), AROS)
244 CC = i386-aros-gcc
245 STRIP = i386-aros-strip
246 OBJDUMP = i386-aros-objdump
247 endif
249 # Compiler/Linker flags
250 OPTFLAGS = -O2 -fomit-frame-pointer
251 CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG
252 LDLIBS += -larossupport -lrom -lmui
254 # we empty the TARGET because we don't support
255 # this platform yet
256 TARGET=
258 else
259 ifeq ($(OS), aros-ppc)
261 ##############################
262 # AROS (PPC)
264 ifneq ($(HOST), AROS)
265 CC = ppc-aros-gcc
266 STRIP = ppc-aros-strip
267 OBJDUMP = ppc-aros-objdump
268 endif
270 # Compiler/Linker flags
271 OPTFLAGS = -O2 -fomit-frame-pointer
272 CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG
273 LDLIBS += -larossupport -lrom -lmui
275 # we empty the TARGET because we don't support
276 # this platform yet
277 TARGET=
279 else
280 ifeq ($(OS), aros-x86_64)
282 ##############################
283 # AROS (x86_64)
285 ifneq ($(HOST), AROS)
286 CC = x86_64-aros-gcc
287 STRIP = x86_64-aros-strip
288 OBJDUMP = x86_64-aros-objdump
289 endif
291 # Compiler/Linker flags
292 OPTFLAGS = -O2 -fomit-frame-pointer
293 CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG
294 LDLIBS += -larossupport -lrom -lmui
296 # we empty the TARGET because we don't support
297 # this platform yet
298 TARGET=
300 endif
301 endif
302 endif
303 endif
304 endif
305 endif
307 ###########################################################################
308 # Here starts all stuff that is common for all target platforms and
309 # hosts.
311 OBJS += OpenURL.o \
312 locale.o \
313 handlers.o \
314 browsers.o \
315 mailers.o \
316 ftps.o \
317 utility.o
319 CATALOGS = $(patsubst %.po,%.catalog,$(wildcard $(LOCALE)/*.po))
321 # main target
322 .PHONY: all
323 ifeq ($(wildcard $(DEPFILE)),$(DEPFILE))
324 # great, we have a dependecies file, let's make our target
325 all: $(BINDIR) $(OBJDIR) locale.h $(TARGET)
326 else
327 # no dependecies, create it and then call make again
328 all: depend
329 @make --no-print-directory all
330 endif
332 # make the object directories
333 $(OBJDIR):
334 @echo " MK $@"
335 @$(MKDIR) $(OBJDIR)
337 # make the object directories
338 $(BINDIR):
339 @echo " MK $@"
340 @$(MKDIR) $(BINDIR)
342 # for compiling single .c files
343 $(OBJDIR)/%.o: %.c
344 @echo " CC $<"
345 @$(CC) $(CFLAGS) -c $< -o $@
347 # for linking the target
348 $(TARGET): $(addprefix $(OBJDIR)/,$(OBJS))
349 @echo " LD $@.debug"
350 @$(CC) $(LDFLAGS) -o $@.debug $(addprefix $(OBJDIR)/,$(OBJS)) $(LDLIBS) -Wl,--cref,-M,-Map=$@.map
351 @echo " LD $@"
352 @$(STRIP) --preserve-dates -R.comment -R.sdata2 -S -o $@ $@.debug
353 @$(CHMOD) $@
355 # for creating a .dump file
356 .PHONY: dump
357 dump:
358 -$(OBJDUMP) --section-headers --all-headers --reloc --disassemble-all $(TARGET).debug > $(TARGET).dump
360 # cleanup target
361 .PHONY: clean
362 clean:
363 -$(RM) $(TARGET) $(TARGET).debug $(TARGET).map $(addprefix $(OBJDIR)/,$(OBJS))
365 # clean all including .obj directory
366 .PHONY: cleanall
367 cleanall: clean
368 -$(RMDIR) $(OBJDIR)
370 # clean all stuff, including our autotools
371 .PHONY: distclean
372 distclean: cleanall
373 -$(RMDIR) $(BINDIR)
375 #install the newly built library to LIBS:
376 .PHONY: install
377 install: all
378 -$(CP) $(TARGET) LIBS:
380 ## CATALOG GENERATION #################
382 $(LOCALE)/%.catalog: $(LOCALE)/%.po $(LOCALE)/OpenURL.pot
383 @echo " MK $@"
384 @$(FC) POFILE $< CATALOG $@
386 locale.h: $(LOCALE)/OpenURL.pot locale_h.sd
387 @echo " MK $@"
388 @$(FC) $(LOCALE)/OpenURL.pot locale.h=locale_h.sd
390 .IGNORE: $(CATALOGS)
392 catalogs: $(CATALOGS)
394 ## DEPENDENCY GENERATION ##############
396 .PHONY: depend
397 depend:
398 @echo " MK $(DEPFILE)"
399 @echo "# AUTOGENERATED! DO NOT EDIT!!!" >$(DEPFILE)
400 @$(CC) -MM -MG $(CFLAGS) $(wildcard *.c) >>$(DEPFILE)
401 @echo "# AUTOGENERATED! DO NOT EDIT!!!" >>$(DEPFILE)
402 @$(SED) -i 's,^\(.*\)\.o:,$$\(OBJDIR\)/\1.o:,g' $(DEPFILE)
404 # include dependencies file
405 -include $(DEPFILE)