OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [services/] [gfx/] [mw/] [v2_0/] [src/] [Makefile.rules] - Blame information for rev 174

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
##############################################################################
2
# Microwindows rules Makefile
3
# Copyright (c) 2000, 2002 Martin Jolicoeur, Greg Haerr
4
#
5
# This makefile should be placed at the top of a project hierarchy
6
#
7
# NOTE: The TOP environment variable should be set to that top directory
8
##############################################################################
9
 
10
ifeq ($(ARCH), DJGPP)
11
SHELL = bash
12
else
13
SHELL = /bin/sh
14
endif
15
 
16
# install directories for headers and libraries
17
INSTALL_PREFIX = /usr
18
HDRINSTALLDIR = $(INSTALL_PREFIX)/include/microwin
19
LIBINSTALLDIR = $(INSTALL_PREFIX)/lib
20
 
21
INSTALL_DIR   = install -c -m 755 -o root -g root -d
22
INSTALL_HDR   = install -c -m 644 -o root -g bin
23
INSTALL_LIB   = install -c -m 444 -o root -g bin
24
 
25
INCLUDEDIRS += -I. -I$(TOP)/include
26
 
27
#
28
# General configuration setup (see config file)
29
#
30
DEFINES += -DMWPIXEL_FORMAT=$(SCREEN_PIXTYPE)
31
 
32
ifeq ($(VTSWITCH), Y)
33
DEFINES += -DVTSWITCH=1
34
endif
35
 
36
ifeq ($(X11), Y)
37
CFLAGS += -DX11=1
38
LDFLAGS += -L/usr/X11R6/lib -lX11
39
endif
40
 
41
ifeq ($(VGALIB), Y)
42
LDFLAGS += -lvga
43
endif
44
 
45
ifeq ($(ARCH),FREEBSD-X86)
46
LDFLAGS += -lvgl
47
endif
48
 
49
ifeq ($(HAVE_FILEIO), Y)
50
 
51
DEFINES += -DHAVE_FILEIO
52
 
53
ifeq ($(HAVE_JPEG_SUPPORT), Y)
54
DEFINES += -DHAVE_JPEG_SUPPORT=1
55
INCLUDEDIRS += -I$(INCJPEG)
56
endif
57
 
58
ifeq ($(HAVE_PNG_SUPPORT), Y)
59
DEFINES += -DHAVE_PNG_SUPPORT=1
60
INCLUDEDIRS += -I$(INCPNG)
61
endif
62
 
63
ifeq ($(HAVE_T1LIB_SUPPORT), Y)
64
DEFINES += -DHAVE_T1LIB_SUPPORT=1
65
INCLUDEDIRS += -I$(INCT1LIB)
66
endif
67
 
68
ifeq ($(HAVE_FREETYPE_SUPPORT), Y)
69
DEFINES += -DHAVE_FREETYPE_SUPPORT=1
70
DEFINES += -DFREETYPE_FONT_DIR=\"$(FREETYPE_FONT_DIR)\"
71
INCLUDEDIRS += -I$(INCFTLIB)
72
endif
73
 
74
ifeq ($(HAVE_HZK_SUPPORT), Y)
75
DEFINES += -DHAVE_HZK_SUPPORT=1
76
DEFINES += -DHZK_FONT_DIR="\"$(HZK_FONT_DIR)"\"
77
endif
78
 
79
ifeq ($(HAVE_BIG5_SUPPORT), Y)
80
DEFINES += -DHAVE_BIG5_SUPPORT=1
81
endif
82
 
83
ifeq ($(HAVE_GB2312_SUPPORT), Y)
84
DEFINES += -DHAVE_GB2312_SUPPORT=1
85
endif
86
 
87
ifeq ($(HAVE_KSC5601_SUPPORT), Y)
88
DEFINES += -DHAVE_KSC5601_SUPPORT=1
89
DEFINES += -DHANGUL_FONT_DIR="\"$(HANGUL_FONT_DIR)"\"
90
endif
91
 
92
ifeq ($(HAVE_BMP_SUPPORT), Y)
93
DEFINES += -DHAVE_BMP_SUPPORT=1
94
endif
95
 
96
ifeq ($(HAVE_GIF_SUPPORT), Y)
97
DEFINES += -DHAVE_GIF_SUPPORT=1
98
endif
99
 
100
ifeq ($(HAVE_PNM_SUPPORT), Y)
101
DEFINES += -DHAVE_PNM_SUPPORT=1
102
endif
103
 
104
ifeq ($(HAVE_XPM_SUPPORT), Y)
105
DEFINES += -DHAVE_XPM_SUPPORT=1
106
endif
107
 
108
endif
109
 
110
ifeq ($(NOFONTSORCLIPPING), Y)
111
CFLAGS += -DNOFONTSORCLIPPING=1
112
endif
113
 
114
ifeq ($(HAVE_SHAREDMEM_SUPPORT), Y)
115
DEFINES += -DHAVE_SHAREDMEM_SUPPORT=1
116
endif
117
 
118
ifeq ($(SHAREDLIBS), Y)
119
CFLAGS += -fpic
120
endif
121
 
122
ifeq ($(OPTIMIZE), Y)
123
OPTFLAGS += -O3
124
endif
125
 
126
ifeq ($(DEBUG), Y)
127
OPTFLAGS += -ggdb
128
else
129
#OPTFLAGS += -DNDEBUG
130
endif
131
 
132
#CFLAGS += $(INCLUDEDIRS)
133
HOSTCFLAGS := $(CFLAGS)
134
CPPFLAGS += $(DEFINES) $(INCLUDEDIRS)
135
LDFLAGS += -L$(BUILD)/lib
136
ARFLAGS = crs
137
 
138
# Tools (may be overridden by Arch.rules)
139
HOSTCC = gcc
140
COMPILER = gcc
141
CXX_COMPILER = g++
142
ACHIVER = ar
143
LINKER = ld
144
 
145
# Include the rules for arch's
146
# if the user has a specific arch local to their home load it
147
ifneq (,$(wildcard $(dir $(CONFIG))/Arch.rules))
148
  include $(wildcard $(dir $(CONFIG))/Arch.rules)
149
else
150
  include $(TOP)/Arch.rules
151
endif
152
 
153
# Tools ...
154
CC = $(TOOLSPREFIX)$(COMPILER)
155
CXX = $(TOOLSPREFIX)$(CXX_COMPILER)
156
AR = $(TOOLSPREFIX)$(ACHIVER)
157
LD = $(TOOLSPREFIX)$(LINKER)
158
NM = $(TOOLSPREFIX)nm
159
STRIP = $(TOOLSPREFIX)strip
160
OBJCOPY = $(TOOLSPREFIX)objcopy
161
CP = cp
162
MV = mv
163
 
164
################## Libraries Section ##################
165
 
166
MWINLIBS = $(BUILD)/lib/libmwin.a $(BUILD)/lib/libmwinlib.a\
167
        $(BUILD)/lib/libmwengine.a $(BUILD)/lib/libmwdrivers.a\
168
        $(BUILD)/lib/libmwfonts.a $(BUILD)/lib/libmwimages.a
169
CCMWINLIBS = -lmwin -lmwinlib -lmwengine -lmwdrivers -lmwfonts -lmwin -lmwimages -lm
170
 
171
ifeq ($(NWIDGET), Y)
172
NANOXCLIENTLIBS += $(BUILD)/lib/libnwidget.a
173
#ifeq ($(LINK_APP_INTO_SERVER), Y)
174
#NANOXSERVERLIBS += $(BUILD)/lib/libnwidget.a
175
#endif
176
endif
177
 
178
ifeq ($(LINK_APP_INTO_SERVER), Y)
179
NANOXCLIENTLIBS += $(BUILD)/lib/libnano-X.a $(BUILD)/lib/libmwengine.a\
180
        $(BUILD)/lib/libmwdrivers.a $(BUILD)/lib/libmwfonts.a
181
CCNANOXCLIENTLIBS += -lnano-X -lmwengine -lmwdrivers -lmwfonts
182
else
183
NANOXCLIENTLIBS += $(BUILD)/lib/libnano-X.a
184
CCNANOXCLIENTLIBS += -lnano-X
185
endif
186
 
187
NANOXSERVERLIBS += $(BUILD)/lib/libmwengine.a $(BUILD)/lib/libmwdrivers.a\
188
        $(BUILD)/lib/libmwfonts.a
189
CCNANOXSERVERLIBS += -lmwengine -lmwdrivers -lmwfonts
190
 
191
ifeq ($(HAVE_FILEIO), Y)
192
ifeq ($(HAVE_JPEG_SUPPORT), Y)
193
MWINLIBS += $(LIBJPEG)
194
CCMWINLIBS += $(LIBJPEG)
195
NANOXLIBS += $(LIBJPEG)
196
NANOXSERVERLIBS += $(LIBJPEG)
197
ifeq ($(SHAREDLIBS), Y)
198
        CCNANOXSERVERLIBS += $(LIBJPEG)
199
endif
200
ifeq ($(LINK_APP_INTO_SERVER), Y)
201
        NANOXCLIENTLIBS += $(LIBJPEG)
202
endif
203
endif
204
ifeq ($(HAVE_PNG_SUPPORT), Y)
205
MWINLIBS += $(LIBPNG) $(LIBZ)
206
CCMWINLIBS += $(LIBPNG) $(LIBZ)
207
NANOXLIBS += $(LIBPNG) $(LIBZ)
208
NANOXSERVERLIBS += $(LIBPNG) $(LIBZ)
209
ifeq ($(SHAREDLIBS), Y)
210
        CCNANOXSERVERLIBS += $(LIBPNG) $(LIBZ)
211
endif
212
ifeq ($(LINK_APP_INTO_SERVER), Y)
213
        NANOXCLIENTLIBS += $(LIBPNG) $(LIBZ)
214
endif
215
endif
216
 
217
endif
218
 
219
ifeq ($(HAVE_T1LIB_SUPPORT), Y)
220
MWINLIBS += $(LIBT1LIB)
221
CCMWINLIBS += $(LIBT1LIB)
222
NANOXLIBS += $(LIBT1LIB)
223
NANOXSERVERLIBS += $(LIBT1LIB)
224
ifeq ($(SHAREDLIBS), Y)
225
        CCNANOXSERVERLIBS += $(LIBT1LIB)
226
endif
227
ifeq ($(LINK_APP_INTO_SERVER), Y)
228
        NANOXCLIENTLIBS += $(LIBT1LIB)
229
endif
230
LDFLAGS += -lm
231
endif
232
 
233
ifeq ($(HAVE_FREETYPE_SUPPORT), Y)
234
MWINLIBS += $(LIBFTLIB)
235
CCMWINLIBS += $(LIBFTLIB)
236
NANOXLIBS += $(LIBFTLIB)
237
NANOXSERVERLIBS += $(LIBFTLIB)
238
ifeq ($(SHAREDLIBS), Y)
239
        CCNANOXSERVERLIBS += $(LIBFTLIB)
240
endif
241
ifeq ($(LINK_APP_INTO_SERVER), Y)
242
        NANOXCLIENTLIBS += $(LIBFTLIB)
243
endif
244
LDFLAGS += -lm
245
endif
246
 
247
ifeq ($(ARCH), ELKS)
248
CCMWINLIBS = $(MWINLIBS)
249
CCNANOXLIBS = $(NANOXLIBS)
250
endif
251
 
252
ifeq ($(ARCH), DJGPP)
253
CCMWINLIBS += -lgrx20
254
CCNANOXLIBS = $(NANOXLIBS)
255
NANOXCLIENTLIBS += -lgrx20
256
endif
257
 
258
################## End of Libraries Section ##################
259
 
260
# If you dont want to see every executed command ...
261
ifeq ($(VERBOSE), N)
262
.SILENT:
263
endif
264
 
265
.PHONY: default subdirs clean cleandepend xconfig
266
 
267
# Add any exportable variable here
268
export TOP BUILD ARCH CONFIG
269
 
270
#
271
# This is the default target
272
# It looks for sub-directories with makefiles in it and tries to execute them
273
#
274
ifeq ($(SHAREDLIBS), Y)
275
default: subdirs $(OBJS) $(CXXOBJS) $(BUILD)/lib/$(LIBNAME) $(BUILD)/lib/$(LIBNAMESO)
276
else
277
default: subdirs $(OBJS) $(CXXOBJS) $(ASMOBJS) $(BUILD)/lib/$(LIBNAME)
278
endif
279
 
280
# 'dirs' can be pre-specified
281
ifeq ($(dirs), )
282
dirs =  $(shell for file in `\ls`; \
283
        do if [ -d $$file -a $$file != "demos" ]; then \
284
        if [ -f $$file/Makefile ]; then echo $$file; fi; fi; done)
285
endif
286
 
287
# 'demos' can be pre-specified
288
ifeq ($(demos), )
289
demos = $(shell for file in `\ls`; \
290
        do if [ -d $$file -a $$file = "demos" ]; then \
291
        if [ -f $$file/Makefile ]; then echo $$file; fi; fi; done)
292
endif
293
 
294
#
295
# Subdirectories target
296
#
297
subdirs:
298
ifeq ($(ARCH), DJGPP)
299
 
300
        $(shell set CURDIR=$(pwd);)
301
 
302
        $(shell \
303
        if [ ! -d $(BUILD)/bin ]; \
304
        then mkdir $(BUILD)/bin; fi;)
305
 
306
        $(shell \
307
        if [ ! -d $(BUILD)/lib ]; \
308
        then mkdir $(BUILD)/lib; fi;)
309
 
310
endif
311
        $(foreach dir, $(dirs), mkdir -p $(dir);)
312
        $(foreach dir, $(dirs), $(MAKE) -C $(dir) -f $(VPATH)/$(dir)/Makefile;)
313
 
314
#
315
# If a library name is specified,
316
# a library of that name will be created with objects in that directory
317
#
318
ifneq ($(LIBNAME), )
319
$(BUILD)/lib/$(LIBNAME): $(OBJS) $(CXXOBJS)
320
        @echo "Creating library $@ ..."
321
        $(AR) $(ARFLAGS) $(BUILD)/lib/$(LIBNAME) $(OBJS) $(CXXOBJS) $(ASMOBJS)
322
endif
323
 
324
#
325
# If a shared object library name is specified, link this object
326
#
327
ifeq ($(SHAREDLIBS), Y)
328
$(BUILD)/lib/$(LIBNAMESO): $(BUILD)/lib/$(LIBNAME)
329
        @echo "Creating shared library $@ ..."
330
        $(LD) -shared -o $@ --whole-archive $^
331
endif
332
 
333
#
334
# Dependencies target for C files
335
#
336
.depend: $(OBJS:.o=.c) $(CXXOBJS:.o=.cc)
337
        @echo "Updating dependencies in $(CURDIR) ..."
338
        $(SHELL) -ec '$(HOSTCC) -MM $(CPPFLAGS) $(HOSTCFLAGS) $^ \
339
        | sed '\''s/\($*\)\.o[ :]*/\1.o \$@ : $$(TOP)\/config /g'\'' > $@; \
340
        [ -s $@ ] || rm -f $@'
341
 
342
#
343
# Compilation target for C files
344
#
345
%.o:%.c
346
        @echo "Compiling $< ..."
347
        $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
348
 
349
 
350
#
351
# Compilation target for C++ files
352
#
353
%.o:%.cc
354
        @echo "C++ compiling $< ..."
355
        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
356
 
357
#
358
# Compilation target for bmp file conversion
359
#
360
%.c:%.bmp $(TOP)/mwin/bmp/convbmp.c
361
        echo "Generating $@ from bitmap file ..."
362
        $(BUILD)/bin/convbmp $< > $@
363
 
364
xconfig:
365
        ./xconfigure
366
 
367
# don't clean lib dir
368
cleanapps: cleandepend
369
        @echo "Cleaning directory $(CURDIR) ..."
370
        $(RM) core *~ *.bak *.o TAGS
371
        $(RM) bin/*
372
        $(foreach dir, $(dirs), $(MAKE) -C $(dir) -f $(TOP)/$(dir)/Makefile cleanapps;)
373
        $(foreach dir, $(demos), $(MAKE) -C $(dir) -f $(TOP)/$(dir)/Makefile cleanapps;)
374
 
375
clean: cleandepend
376
        @echo "Cleaning directory $(CURDIR) ..."
377
        $(RM) core *~ *.bak *.o TAGS
378
        $(RM) $(BUILD)/lib/*.a $(BUILD)/lib/*.so
379
        $(shell cd $(BUILD)/bin && \
380
                for file in `\ls`; do if [ ! -d $$file ]; \
381
                then $(RM) $$file; fi; done; cd $(TOP))
382
        $(foreach dir, $(dirs), $(MAKE) -C $(dir) -f $(TOP)/$(dir)/Makefile clean;)
383
        $(foreach dir, $(demos), $(MAKE) -C $(dir) -f $(TOP)/$(dir)/Makefile clean;)
384
 
385
 
386
cleandepend:
387
        @echo "Cleaning dependencies in directory $(CURDIR) ..."
388
        $(RM) .depend
389
        $(foreach dir, $(dirs), $(MAKE) -C $(dir) -f $(TOP)/$(dir)/Makefile cleandepend;)
390
        $(foreach dir, $(demos), $(MAKE) -C $(dir) -f $(TOP)/$(dir)/Makefile cleandepend;)
391
 
392
install: default
393
        $(INSTALL_DIR) $(HDRINSTALLDIR)
394
        echo "Copying hdrs to $(HDRINSTALLDIR)"
395
        $(INSTALL_HDR) include/*.h $(HDRINSTALLDIR)
396
        echo "Copying libs to $(LIBINSTALLDIR)"
397
        $(INSTALL_DIR) $(LIBINSTALLDIR)
398
        $(INSTALL_LIB) lib/*.a $(LIBINSTALLDIR)
399
ifeq ($(SHAREDLIBS), Y)
400
        $(INSTALL_LIB) lib/*.so $(LIBINSTALLDIR)
401
endif
402
        echo "Installation completed successfully."
403
 
404
tags:
405
        -rm -f TAGS
406
        etags --language=c++ --append \
407
                `find . \( -name '*.h' -o -name '*.cc' \) -print`
408
        etags --language=c --append `find . -name \*.[hc] -print`
409
        etags --language=asm --append `find . -name \*.[Ss] -print`
410
 
411
#
412
# Included dependency files
413
#
414
ifneq ($(MAKECMDGOALS), clean)
415
ifneq ($(MAKECMDGOALS), cleandepend)
416
ifneq ($(MAKECMDGOALS), realclean)
417
ifneq ($(MAKECMDGOALS), xconfig)
418
ifneq ($(OBJS),)
419
-include .depend
420
endif
421
endif
422
endif
423
endif
424
endif
425
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.