handle USER_INCLUDES via the CPPFLAGS
[AROS.git] / compiler / include / mmakefile.in
blobd1f2b78f56eab61d6f2cb5337b1411ea53d757fd
1 # $Id$
3 include $(SRCDIR)/config/aros.cfg
5 INCSUBDIRS :=   aros                            \
6                 aros/preprocessor               \
7                 aros/preprocessor/facilities    \
8                 aros/preprocessor/variadic      \
9                 aros/types                      \
10                 asm                             \
11                 bluetooth                       \
12                 c++                             \
13                 c++/exec                        \
14                 clib                            \
15                 datatypes                       \
16                 defines                         \
17                 devices                         \
18                 diskfont                        \
19                 dos                             \
20                 exec                            \
21                 gadgets                         \
22                 graphics                        \
23                 hardware                        \
24                 hardware/cpu                    \
25                 hardware/efi                    \
26                 hardware/pic                    \
27                 hidd                            \
28                 inline                          \
29                 intuition                       \
30                 irda                            \
31                 libcore                         \
32                 libraries                       \
33                 midi                            \
34                 pragmas                         \
35                 prefs                           \
36                 proto                           \
37                 resources                       \
38                 rexx                            \
39                 SDI                             \
40                 scsi                            \
41                 utility                         \
42                 workbench
44 # clib & proto are handled above.
45 INCEMPTYDIRS := defines                         \
46                 inline
48 INCLUDES_BASE    := $(foreach d,$(addprefix $(SRCDIR)/$(CURDIR)/,$(INCSUBDIRS)),$(wildcard $(d)/*.h) $(wildcard $(d)/*.hpp)) $(wildcard *.h)
49 INCLUDES      := $(subst $(SRCDIR)/$(CURDIR)/,,$(INCLUDES_BASE))
50 ARCHINCDIR    := $(SRCDIR)/arch/$(CPU)-$(ARCH)/include/
51 ARCH_INCLUDES := $(subst $(ARCHINCDIR),,$(foreach d,$(addprefix $(ARCHINCDIR),$(INCSUBDIRS)),$(wildcard $(d)/*.h) $(wildcard $(d)/*.hpp)))
52 INCLUDES      := $(filter-out $(ARCH_INCLUDES),$(INCLUDES))
53 DEST_INCLUDES := $(foreach f,$(INCLUDES),$(AROS_INCLUDES)/$(f))
54 GEN_INCLUDES  := $(foreach f,$(INCLUDES),$(GENINCDIR)/$(f))
55 INCL_DIRS     := $(foreach dir,$(INCSUBDIRS) $(INCEMPTYDIRS),$(AROS_INCLUDES)/$(dir)) \
56                  $(foreach dir,$(INCSUBDIRS) $(INCEMPTYDIRS),$(GENINCDIR)/$(dir))
58 #MM- includes : includes-generate
59 #MM- includes-generate : includes-generate-deps
60 #MM- includes-generate-deps : includes-copy includes-$(ARCH)-$(CPU)
61 #MM- includes-copy : compiler-includes includes-copy-$(ARCH)-$(CPU)
63 #MM- includes-$(ARCH)-$(CPU) : \
64 #MM     includes-copy-$(ARCH)-$(CPU) \
65 #MM     includes-generate-$(ARCH)-$(CPU)
66 #MM- includes-generate-$(ARCH)-$(CPU) : includes-copy-$(ARCH)-$(CPU)
67 #MM- includes-copy-$(ARCH)-$(CPU) :
69 #MM
70 compiler-includes : setup $(DEST_INCLUDES) $(GEN_INCLUDES) includes-execbase_h
72 # execbase is copied seperately, since on SMP builds we need to
73 # remove some fields
75 EXECSMP="@ENABLE_EXECSMP@"
77 $(GENINCDIR)/exec/execbase.h : $(SRCDIR)/$(CURDIR)/exec/execbase.inc
78         @$(ECHO) "Copying    C   includes to $(GENINCDIR)..."
79         @$(CP) $< $@
80 ifneq ($(strip $(EXECSMP)),"")
81         $(SED) -i -e 's/.*ThisTask;.*/    IPTR         SMPPrivate1;/' -e 's/.*Quantum;.*/    WORD         SMPPrivate2;/' -e 's/.*Elapsed;.*/    WORD         SMPPrivate3;/' -e 's/.*IDNestCnt;.*/    UBYTE        SMPPrivate4;/' -e 's/.*TDNestCnt;.*/    UBYTE        SMPPrivate5;/' $@
82 endif
84 $(AROS_INCLUDES)/exec/execbase.h : $(GENINCDIR)/exec/execbase.h
85         @$(ECHO) "Copying    C   includes to $(AROS_INCLUDES)..."
86         @$(CP) $< $@
88 #MM
89 includes-execbase_h : $(AROS_INCLUDES)/exec/execbase.h
91 .PHONY : includes-execbase_h
93 # normal include copy routines
95 $(AROS_INCLUDES)/%.h : $(SRCDIR)/$(CURDIR)/%.h
96         @$(ECHO) "Copying    C   includes to $(AROS_INCLUDES)..."
97         @$(CP) $< $@
99 $(GENINCDIR)/%.h : $(SRCDIR)/$(CURDIR)/%.h
100         @$(ECHO) "Copying    C   includes to $(GENINCDIR)..."
101         @$(CP) $< $@
103 $(AROS_INCLUDES)/%.hpp : $(SRCDIR)/$(CURDIR)/%.hpp
104         @$(ECHO) "Copying    C++ includes to $(AROS_INCLUDES)..."
105         @$(CP) $< $@
107 $(GENINCDIR)/%.hpp : $(SRCDIR)/$(CURDIR)/%.hpp
108         @$(ECHO) "Copying    C++ includes to $(GENINCDIR)..."
109         @$(CP) $< $@
111 setup : $(INCL_DIRS)
113 $(INCL_DIRS) :
114         @$(ECHO) "Creating   $@..."
115         @$(MKDIR) $@
118 includes-asm_h-$(CPU) : $(GENINCDIR)/aros/$(CPU)/asm.h
120 .PHONY : includes-asm_h-$(CPU)
122 $(OBJDIR)/asm.s : $(SRCDIR)/$(CURDIR)/asm.c | $(OBJDIR)
123         @$(ECHO) "Compiling  $<..."
124         @$(TARGET_CC) $(TARGET_SYSROOT) $(CFLAGS) $(PRIV_EXEC_INCLUDES) $(PRIV_KERNEL_INCLUDES) -S $< -o $@
126 $(GENINCDIR)/aros/$(CPU)/asm.h : $(OBJDIR)/asm.s | $(GENINCDIR)/aros/$(AROS_TARGET_CPU)
127         @$(ECHO) Generating $@...
128         grep ".asciz" $< | cut -d'"' -f2 | sed 's/\$$//g' >$@
130 $(OBJDIR) :
131         @$(MKDIR) $@
133 $(GENINCDIR)/aros/$(CPU) :
134         @$(MKDIR) $@
137 clean :
138         -$(RM) $(AROS_INCLUDES) $(GENINCDIR)