OSDN Git Service

Update upcoming new infrastructure files
[uclinux-h8/uClibc.git] / Makerules
1 #
2 # Licensed under LGPL v2.1, see the file COPYING.LIB in this tarball for details.
3 #
4 .SUFFIXES: .c .S .o .os .so .a .s
5
6 ifndef top_srcdir
7 top_srcdir=$(CURDIR)
8 endif
9
10 ifndef top_builddir
11 top_builddir=$(CURDIR)
12 endif
13
14 top_srcdir:=$(shell echo "$(top_srcdir)/" | sed -e 's://:/:')
15 top_builddir:=$(shell echo "$(top_builddir)/" | sed -e 's://:/:')
16
17 ifeq ($(HAVE_SHARED),y)
18 .LIBPATTERNS: "lib%.so"
19 libs: libso-y liba-y
20 else
21 .LIBPATTERNS: "lib%.a"
22 libs: liba-y
23 endif
24
25 libso-y: $(libso-y)
26 liba-y: $(liba-y)
27 libclean-y: $(libclean-y)
28
29 compile.c=$(CC) -c $< -o $@ $(CPPFLAGS) $(CFLAGS) $(ARCH_CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$@) $(CFLAGS-$<)
30 compile.S=$(compile.c) $(S_CPPFLAGS) $(ASFLAGS) $(ARCH_ASFLAGS) $(ASFLAGS-$(suffix $@)) $(ASFLAGS-$@) $(ASFLAGS-$<)
31 compile.m=$(compile.c) -DL_$(patsubst %$(suffix $(notdir $@)),%,$(notdir $@))
32
33 .PHONY: clean
34 clean: libclean-y