r6831@lvps87-230-33-50: verhaegs | 2008-02-03 14:08:57 +0100
[tangerine.git] / compiler / clib / stubs / mmakefile.src
blob902cf3cf24263ce950398d4fc3380b4f7a633094
1 # $Id$
2 include $(TOP)/config/make.cfg
4 STUBSDIR        := $(GENDIR)/compiler/clib/stubs
5 FILES           := $(shell ($(ECHO) '\#define SYSTEM_CALL(x, y...) x'; $(CAT) $(AROS_INCLUDES)/sys/syscall.def) | $(CPP) -P -)
6 FILES           := $(addprefix $(STUBSDIR)/,$(FILES))
7 OBJS            := $(addsuffix .o,$(FILES))
8 STUBS           := $(addsuffix .S,$(FILES))
9 GENSTUBS        := genstubs
11 #MM
12 clib-stubs : $(OBJS)
14 #MM
15 clib-stubs-clean : clean
17 #MM
18 clean ::
19         -$(RM) $(STUBSDIR)
21 $(OBJS) $(STUBS) : | $(STUBSDIR)
22 %rule_makedirs dirs=$(STUBSDIR)
24 $(OBJS) : $(STUBSDIR)/%.o : $(STUBSDIR)/%.S
25         %assemble_q
27 $(STUBSDIR)/%.S: $(STUBSDIR)/$(GENSTUBS)
28         @$(ECHO) Generating stub function for \'$$(basename $(notdir $@))\'...
29         @$(STUBSDIR)/$(GENSTUBS) $(basename $(notdir $@)) >$@
31 $(STUBSDIR)/$(GENSTUBS) : $(GENSTUBS).c $(AROS_INCLUDES)/sys/syscall.def \
32     $(AROS_INCLUDES)/aros/cpu.h $(STUBSDIR)/archspecific.h
33         @$(HOST_CC) $(HOST_CFLAGS) -I$(GENINCDIR) -I$(STUBSDIR) $< -o $@
35 $(STUBSDIR)/archspecific.h: archspecific.c $(GENINCDIR)/aros/$(AROS_TARGET_CPU)/cpu.h | $(STUBSDIR)
36         @$(TARGET_CC) -S $< -o $(STUBSDIR)/archspecific.s
37         @grep "^[/#][*d]" $(STUBSDIR)/archspecific.s | $(SED) s/@SED@[$$]//g >$@
38         @$(RM) $(STUBSDIR)/archspecific.s