diff options
| author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2012-02-19 05:56:38 +0100 |
|---|---|---|
| committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2012-02-19 05:56:38 +0100 |
| commit | 19796a75ab8ba43b31e230ea169d5383c6392bfc (patch) | |
| tree | 3041c5678e06133dd7fcbf2ebf34b6506334f677 /libdde_linux26/Makeconf | |
| parent | 6b2e5e0d91823c2a6ce5a5cb12ae3d00b82adae7 (diff) | |
| parent | 8df772b3c665e663f6f9d2a70f9c691590bd3f91 (diff) | |
Merge branch 'dde' into upstream-merged
Diffstat (limited to 'libdde_linux26/Makeconf')
| -rw-r--r-- | libdde_linux26/Makeconf | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/libdde_linux26/Makeconf b/libdde_linux26/Makeconf new file mode 100644 index 00000000..4ee54c66 --- /dev/null +++ b/libdde_linux26/Makeconf @@ -0,0 +1,51 @@ +# Linux 2.6 defines some macros on command line +KBUILD_DEFINES = -D"KBUILD_STR(s)=\#s" \ + -D"KBUILD_BASENAME=KBUILD_STR($(patsubst %.o, %, $(notdir $@)))" \ + -D"KBUILD_MODNAME=KBUILD_STR($(patsubst %.o, %, $@))" + +# for some reasons, Linux 2.6 does not include autoconf.h in the implementation +# files but does so on the command line +ifeq ($(ARCH), x86) +KBUILD_CPPFLAGS = -include linux/autoconf.h +endif + +ifeq ($(ARCH), arm) +KBUILD_CPPFLAGS = -include linux/autoconf-arm.h +endif + +# includes +MY_DDE_INCDIR = $(OBJ_BASE)/include/$(ARCH) \ + $(OBJ_BASE)/include/ + +SUFFIX_amd64 = x86_64 +SUFFIX_x86 = x86 +SUFFIX_arm = arm + +MY_LINUX26_INCDIR = $(OBJ_BASE)/include/$(ARCH)/linux-headers \ + $(OBJ_BASE)/include/$(ARCH)/asm \ + $(OBJ_BASE)/include/linux-headers + +# stolen from fiasco/src/Makeconf, checks whether a compiler supports a certain +# parameter +CHECKCC = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \ + > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) + +# Linux always uses C... +MODE_USE_C = y +L4_MULTITHREADED = y + +# arch-specific stuff +ifeq ($(ARCH), x86) +MY_DDE_INCDIR += $(OBJ_BASE)/include/linux-headers/asm/mach-default +endif + +PRIVATE_INCDIR += $(MY_DDE_INCDIR) $(MY_LINUX26_INCDIR) $(PKGDIR)/../libddekit/include + +DEFINES += -D__KERNEL__ -DDDE_LINUX $(KBUILD_DEFINES) +CPPFLAGS += $(KBUILD_CPPFLAGS) +CFLAGS += -ffunction-sections +ASFLAGS += -D__ASSEMBLY__ + +WARNINGS += -Wall -Wstrict-prototypes -fno-strict-aliasing +WARNINGS += $(call CHECKCC, -Wno-unused,) +WARNINGS += $(call CHECKCC, -Wno-pointer-sign,) |
