diff options
author | Zheng Da <zhengda1936@gmail.com> | 2009-12-21 22:53:52 +0100 |
---|---|---|
committer | Zheng Da <zhengda1936@gmail.com> | 2009-12-21 22:53:52 +0100 |
commit | de60719e36c86cd19e7ace9a1f1c485ce2af4060 (patch) | |
tree | 06acc872b691d54377e483fb9c0fb8268a30c1d8 | |
parent | 7ccfc1fdb1c0030e6e2105d50d76122b8f10c687 (diff) |
a temporary version of Makefiles for libdde_linux26
-rw-r--r-- | libdde_linux26/Makeconf | 51 | ||||
-rw-r--r-- | libdde_linux26/Makefile | 6 | ||||
-rw-r--r-- | libdde_linux26/contrib/Makefile | 6 | ||||
-rw-r--r-- | libdde_linux26/contrib/arch/x86/include/Makefile | 4 | ||||
-rw-r--r-- | libdde_linux26/contrib/include/Makefile | 6 | ||||
-rw-r--r-- | libdde_linux26/include/Makefile | 6 | ||||
-rw-r--r-- | libdde_linux26/lib/Makefile | 10 | ||||
-rw-r--r-- | libdde_linux26/lib/src/Makefile | 15 | ||||
-rw-r--r-- | libdde_linux26/lib/src/Makefile.inc | 50 | ||||
-rw-r--r-- | libdde_linux26/mk/Makeconf | 64 | ||||
-rw-r--r-- | libdde_linux26/mk/include.mk | 2 | ||||
-rw-r--r-- | libdde_linux26/mk/lib.mk | 3 | ||||
-rw-r--r-- | libdde_linux26/mk/subdir.mk | 10 |
13 files changed, 168 insertions, 65 deletions
diff --git a/libdde_linux26/Makeconf b/libdde_linux26/Makeconf new file mode 100644 index 00000000..de84e39a --- /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)/l4/dde/linux26 \ + $(OBJ_BASE)/include/l4/dde/linux26 + +SUFFIX_amd64 = x86_64 +SUFFIX_x86 = x86 +SUFFIX_arm = arm + +MY_LINUX26_INCDIR = $(OBJ_BASE)/include/$(ARCH)/l4/dde/linux26/linux-headers \ + $(OBJ_BASE)/include/$(ARCH)/l4/dde/linux26/asm \ + $(OBJ_BASE)/include/l4/dde/linux26/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/l4/dde/linux26/linux-headers/asm/mach-default +endif + +PRIVATE_INCDIR += $(MY_DDE_INCDIR) $(MY_LINUX26_INCDIR) + +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,) diff --git a/libdde_linux26/Makefile b/libdde_linux26/Makefile index 5d180d78..092ea77e 100644 --- a/libdde_linux26/Makefile +++ b/libdde_linux26/Makefile @@ -1,6 +1,6 @@ -PKGDIR ?= .. -L4DIR ?= $(PKGDIR)/../.. +PKGDIR ?= . +L4DIR ?= $(PKGDIR) -TARGET = contrib include lib examples +TARGET = contrib include lib include $(L4DIR)/mk/subdir.mk diff --git a/libdde_linux26/contrib/Makefile b/libdde_linux26/contrib/Makefile index ec3eca26..232423de 100644 --- a/libdde_linux26/contrib/Makefile +++ b/libdde_linux26/contrib/Makefile @@ -1,5 +1,7 @@ -PKGDIR ?= ../.. -L4DIR ?= $(PKGDIR)/../.. +PKGDIR ?= .. +L4DIR ?= $(PKGDIR) + +BUILD_ARCH := x86 TARGET = include arch/$(BUILD_ARCH)/include diff --git a/libdde_linux26/contrib/arch/x86/include/Makefile b/libdde_linux26/contrib/arch/x86/include/Makefile index c374502c..665e84a2 100644 --- a/libdde_linux26/contrib/arch/x86/include/Makefile +++ b/libdde_linux26/contrib/arch/x86/include/Makefile @@ -1,5 +1,5 @@ -PKGDIR ?= ../../../../.. -L4DIR ?= $(PKGDIR)/../.. +PKGDIR ?= ../../../.. +L4DIR ?= $(PKGDIR) # Force these include files to appear in a special subfolder of dde/ INSTALL_INC_PREFIX = l4/dde/linux26/linux-headers/ diff --git a/libdde_linux26/contrib/include/Makefile b/libdde_linux26/contrib/include/Makefile index 009352f5..fa9f5f1b 100644 --- a/libdde_linux26/contrib/include/Makefile +++ b/libdde_linux26/contrib/include/Makefile @@ -1,8 +1,8 @@ -PKGDIR ?= ../../.. -L4DIR ?= $(PKGDIR)/../.. +PKGDIR ?= ../.. +L4DIR ?= $(PKGDIR) # Force these include files to appear in a special subfolder of dde/ -INSTALL_INC_PREFIX = l4/dde/linux26/linux-headers +INSTALL_INC_PREFIX = linux-headers include $(L4DIR)/mk/include.mk diff --git a/libdde_linux26/include/Makefile b/libdde_linux26/include/Makefile index a300aaaf..7584d036 100644 --- a/libdde_linux26/include/Makefile +++ b/libdde_linux26/include/Makefile @@ -1,10 +1,10 @@ -PKGDIR ?= ../.. -L4DIR ?= $(PKGDIR)/../.. +PKGDIR ?= .. +L4DIR ?= $(PKGDIR) # Force these include files to appear in a special subfolder of dde/ INSTALL_INC_PREFIX = l4/dde/linux26 -include $(L4DIR)/mk/Makeconf +#include $(L4DIR)/mk/Makeconf -include $(PKGDIR_OBJ)/Makeconf include $(L4DIR)/mk/include.mk diff --git a/libdde_linux26/lib/Makefile b/libdde_linux26/lib/Makefile index 0ea410d0..7e6ceb0c 100644 --- a/libdde_linux26/lib/Makefile +++ b/libdde_linux26/lib/Makefile @@ -1,11 +1,11 @@ -PKGDIR ?= ../.. -L4DIR ?= $(PKGDIR)/../.. +PKGDIR ?= .. +L4DIR ?= $(PKGDIR) -include $(L4DIR)/mk/Makeconf +#include $(L4DIR)/mk/Makeconf -include $(PKGDIR_OBJ)/Makeconf -ifeq ($(CONFIG_DDE26),y) +#ifeq ($(CONFIG_DDE26),y) TARGET = src src_ip -endif +#endif include $(L4DIR)/mk/subdir.mk diff --git a/libdde_linux26/lib/src/Makefile b/libdde_linux26/lib/src/Makefile index 3707b2cb..7802479b 100644 --- a/libdde_linux26/lib/src/Makefile +++ b/libdde_linux26/lib/src/Makefile @@ -1,9 +1,15 @@ -PKGDIR ?= ../../.. -L4DIR ?= $(PKGDIR)/../.. -CONTRIB ?= $(PKGDIR)/linux26/contrib +PKGDIR ?= ../.. +L4DIR ?= $(PKGDIR) +CONTRIB ?= $(PKGDIR)/contrib -include $(PKGDIR_OBJ)/Makeconf +CONFIG_DDE26_COMMON := y +CONFIG_DDE26_NET := y +CONFIG_DDE26_BLOCK := y +CONFIG_DDE26_SOUND := y +CONFIG_DDE26_CHAR :=y + ifeq ($(CONFIG_DDE26_COMMON),y) TARGET += libdde_linux26.o.a endif @@ -25,6 +31,7 @@ TARGET += libdde_linux26_char.a endif SYSTEMS = x86-l4v2 +ARCH = x86 ifeq ($(ARCH), x86) ARCH_DIR = arch/x86 @@ -225,6 +232,6 @@ gen_crc32table : lib/gen_crc32table.c @$(GEN_MESSAGE) $(VERBOSE)$(HOST_CC) -O2 -o $@ $< -include $(PKGDIR)/linux26/Makeconf +include $(PKGDIR)/Makeconf include $(L4DIR)/mk/lib.mk diff --git a/libdde_linux26/lib/src/Makefile.inc b/libdde_linux26/lib/src/Makefile.inc new file mode 100644 index 00000000..12df220d --- /dev/null +++ b/libdde_linux26/lib/src/Makefile.inc @@ -0,0 +1,50 @@ +# automatically generated, do not edit! + +IDL_SRC_C_libdde_linux26.o.a= +IDL_SRC_C_libdde_linux26_net.a= +IDL_SRC_C_libdde_linux26_block.a= +IDL_SRC_C_libdde_linux26_sound.a= +IDL_SRC_C_libdde_linux26_char.a= +SRC_C_libdde_linux26.o.a += $(IDL_SRC_C_libdde_linux26.o.a) +SRC_C_libdde_linux26_net.a += $(IDL_SRC_C_libdde_linux26_net.a) +SRC_C_libdde_linux26_block.a += $(IDL_SRC_C_libdde_linux26_block.a) +SRC_C_libdde_linux26_sound.a += $(IDL_SRC_C_libdde_linux26_sound.a) +SRC_C_libdde_linux26_char.a += $(IDL_SRC_C_libdde_linux26_char.a) +Makefile.inc: IDL_SRC_C_libdde_linux26.o.a= +Makefile.inc: IDL_SRC_C_libdde_linux26_net.a= +Makefile.inc: IDL_SRC_C_libdde_linux26_block.a= +Makefile.inc: IDL_SRC_C_libdde_linux26_sound.a= +Makefile.inc: IDL_SRC_C_libdde_linux26_char.a= +IDL_SRC_CC_libdde_linux26.o.a= +IDL_SRC_CC_libdde_linux26_net.a= +IDL_SRC_CC_libdde_linux26_block.a= +IDL_SRC_CC_libdde_linux26_sound.a= +IDL_SRC_CC_libdde_linux26_char.a= +SRC_CC_libdde_linux26.o.a += $(IDL_SRC_CC_libdde_linux26.o.a) +SRC_CC_libdde_linux26_net.a += $(IDL_SRC_CC_libdde_linux26_net.a) +SRC_CC_libdde_linux26_block.a += $(IDL_SRC_CC_libdde_linux26_block.a) +SRC_CC_libdde_linux26_sound.a += $(IDL_SRC_CC_libdde_linux26_sound.a) +SRC_CC_libdde_linux26_char.a += $(IDL_SRC_CC_libdde_linux26_char.a) +Makefile.inc: IDL_SRC_CC_libdde_linux26.o.a= +Makefile.inc: IDL_SRC_CC_libdde_linux26_net.a= +Makefile.inc: IDL_SRC_CC_libdde_linux26_block.a= +Makefile.inc: IDL_SRC_CC_libdde_linux26_sound.a= +Makefile.inc: IDL_SRC_CC_libdde_linux26_char.a= +OBJS_libdde_linux26.o.a += arch/l4/cli_sti.o arch/l4/fs.o arch/l4/hw-helpers.o arch/l4/init_task.o arch/l4/init.o arch/l4/pci.o arch/l4/power.o arch/l4/process.o arch/l4/res.o arch/l4/sched.o arch/l4/signal.o arch/l4/smp.o arch/l4/softirq.o arch/l4/timer.o arch/l4/page_alloc.o arch/l4/kmem_cache.o arch/l4/kmalloc.o arch/l4/irq.o arch/l4/param.o arch/l4/vmalloc.o arch/l4/vmstat.o arch/l4/mm-helper.o lib/rwsem.o arch/x86/kernel/pci-dma.o arch/x86/kernel/pci-nommu.o kernel/exit.o kernel/kthread.o kernel/mutex.o kernel/notifier.o kernel/resource.o kernel/rwsem.o kernel/sched.o kernel/semaphore.o kernel/sys.o kernel/time.o kernel/timer.o kernel/wait.o kernel/workqueue.o lib/bitmap.o lib/bitrev.o lib/crc32.o lib/ctype.o lib/cpumask.o lib/find_next_bit.o lib/hexdump.o lib/idr.o lib/iomap.o lib/hweight.o lib/kasprintf.o lib/kernel_lock.o lib/klist.o lib/kobject.o lib/kref.o lib/parser.o lib/proportions.o lib/radix-tree.o lib/scatterlist.o lib/sha1.o lib/string.o lib/vsprintf.o mm/dmapool.o mm/mempool.o mm/swap.o mm/util.o drivers/base/attribute_container.o drivers/base/bus.o drivers/base/class.o drivers/base/core.o drivers/base/cpu.o drivers/base/dd.o drivers/base/devres.o drivers/base/driver.o drivers/base/init.o drivers/base/map.o drivers/base/platform.o drivers/base/sys.o drivers/pci/access.o drivers/pci/bus.o drivers/pci/hotplug-pci.o drivers/pci/pci.o drivers/pci/pci-driver.o drivers/pci/probe.o drivers/pci/search.o drivers/pci/setup-bus.o drivers/pci/setup-res.o arch/x86/lib/semaphore_32.o +OBJS_libdde_linux26_net.a += arch/l4/net.o drivers/net/mii.o net/core/dev.o net/core/dev_mcast.o net/core/ethtool.o net/core/link_watch.o net/core/neighbour.o net/core/netevent.o net/core/net-sysfs.o net/core/net_namespace.o net/core/rtnetlink.o net/core/skbuff.o net/core/skb_dma_map.o net/core/utils.o net/ethernet/eth.o net/sched/sch_generic.o arch/x86/lib/checksum_32.o +OBJS_libdde_linux26_block.a += arch/l4/inodes.o block/blk-barrier.o block/blk-core.o block/blk-exec.o block/blk-ioc.o block/blk-merge.o block/blk-settings.o block/blk-softirq.o block/blk-sysfs.o block/blk-tag.o block/blk-timeout.o block/elevator.o block/genhd.o block/noop-iosched.o block/ioctl.o block/scsi_ioctl.o mm/backing-dev.o mm/bounce.o mm/page-writeback.o fs/bio.o fs/block_dev.o fs/buffer.o fs/filesystems.o +OBJS_libdde_linux26_sound.a += sound/sound_core.o arch/l4/sound.o +OBJS_libdde_linux26_char.a += arch/l4/inodes.o fs/char_dev.o + + +libdde_linux26.o.a: $(OBJS_libdde_linux26.o.a) +libdde_linux26_net.a: $(OBJS_libdde_linux26_net.a) +libdde_linux26_block.a: $(OBJS_libdde_linux26_block.a) +libdde_linux26_sound.a: $(OBJS_libdde_linux26_sound.a) +libdde_linux26_char.a: $(OBJS_libdde_linux26_char.a) + +$(OBJS_libdde_linux26.o.a): .general.d +$(OBJS_libdde_linux26_net.a): .general.d +$(OBJS_libdde_linux26_block.a): .general.d +$(OBJS_libdde_linux26_sound.a): .general.d +$(OBJS_libdde_linux26_char.a): .general.d diff --git a/libdde_linux26/mk/Makeconf b/libdde_linux26/mk/Makeconf index 1c927e45..5a1e495c 100644 --- a/libdde_linux26/mk/Makeconf +++ b/libdde_linux26/mk/Makeconf @@ -139,19 +139,19 @@ findfile = $(firstword $(wildcard $(addsuffix /$(1),$(2))) $(1)_NOT_FOUND) # include this one early to be able to set OBJ_BASE -include $(L4DIR)/Makeconf.local -ifeq ($(filter $(IGNORE_OBJDIR_TARGETS),$(MAKECMDGOALS)),) +#ifeq ($(filter $(IGNORE_OBJDIR_TARGETS),$(MAKECMDGOALS)),) # output directory -ifeq ($(O)$(OBJ_BASE),) -$(error need to give builddir with O=.../builddir) -else -ifneq ($(O),) -ifeq ($(origin OBJ_BASE),undefined) -OBJ_BASE := $(call absfilename, $(O)) -export OBJ_BASE -endif -endif -endif -endif +#ifeq ($(O)$(OBJ_BASE),) +#$(error need to give builddir with O=.../builddir) +#else +#ifneq ($(O),) +#ifeq ($(origin OBJ_BASE),undefined) +#OBJ_BASE := $(call absfilename, $(O)) +#export OBJ_BASE +#endif +#endif +#endif +#endif ifeq ($(origin L4DIR_ABS),undefined) L4DIR_ABS := $(call absfilename,$(L4DIR)) @@ -207,25 +207,25 @@ VPATH_SRC_BASE ?= $(SRC_DIR) # Makeconf.local handling # dont use -include here, as we have special build conditions in $(L4DIR)/ -ifeq ($(origin BID_ROOT_CONF),undefined) -BID_ROOT_CONF := $(call absfilename, $(OBJ_BASE))/Makeconf.bid.local -endif -ifeq ($(filter $(IGNORE_OBJDIR_TARGETS),$(MAKECMDGOALS)),) -ifeq ($(wildcard $(BID_ROOT_CONF)),) -ifeq ($(BID_IGN_ROOT_CONF),) -$(error No configuration file found in build directory "$(OBJ_BASE)". Please run "make O=/path/to/objdir config" in "$(L4DIR_ABS)" or specify a valid build directory) -endif -else -include $(BID_ROOT_CONF) -endif -endif - --include $(L4DIR)/Makeconf.$(CONFIG_LABEL) - --include $(OBJ_BASE)/Makeconf.local -ifneq ($(PKGDIR),) --include $(PKGDIR)/Makeconf.local -endif +#ifeq ($(origin BID_ROOT_CONF),undefined) +#BID_ROOT_CONF := $(call absfilename, $(OBJ_BASE))/Makeconf.bid.local +#endif +#ifeq ($(filter $(IGNORE_OBJDIR_TARGETS),$(MAKECMDGOALS)),) +#ifeq ($(wildcard $(BID_ROOT_CONF)),) +#ifeq ($(BID_IGN_ROOT_CONF),) +#$(error No configuration file found in build directory "$(OBJ_BASE)". Please run "make O=/path/to/objdir config" in "$(L4DIR_ABS)" or specify a valid build directory) +#endif +#else +#include $(BID_ROOT_CONF) +#endif +#endif + +#-include $(L4DIR)/Makeconf.$(CONFIG_LABEL) + +#-include $(OBJ_BASE)/Makeconf.local +#ifneq ($(PKGDIR),) +#-include $(PKGDIR)/Makeconf.local +#endif # if it is not already set, we use this in the local dir MAKECONFLOCAL ?= Makeconf.local -include $(MAKECONFLOCAL) @@ -248,7 +248,7 @@ PL_j := -j $(PL) export PL endif -include $(L4DIR)/mk/config.inc +#include $(L4DIR)/mk/config.inc ifeq ($(HAVE_LDSO),y) # MAKEDEP-call: diff --git a/libdde_linux26/mk/include.mk b/libdde_linux26/mk/include.mk index 4725374b..3e325cd4 100644 --- a/libdde_linux26/mk/include.mk +++ b/libdde_linux26/mk/include.mk @@ -34,7 +34,7 @@ endif INSTALL_INC_PREFIX ?= l4/$(PKGNAME) INCSRC_DIR ?= $(SRC_DIR) -include $(L4DIR)/mk/Makeconf +#include $(L4DIR)/mk/Makeconf $(GENERAL_D_LOC): $(L4DIR)/mk/include.mk -include $(DEPSVAR) diff --git a/libdde_linux26/mk/lib.mk b/libdde_linux26/mk/lib.mk index 3ae24dbe..c96fcaaf 100644 --- a/libdde_linux26/mk/lib.mk +++ b/libdde_linux26/mk/lib.mk @@ -16,6 +16,7 @@ ifeq ($(origin _L4DIR_MK_LIB_MK),undefined) _L4DIR_MK_LIB_MK=y ROLE = lib.mk +SYSTEM = x86-l4v2 # define INSTALLDIRs prior to including install.inc, where the install- # rules are defined. Same for INSTALLDIR. @@ -60,7 +61,7 @@ LDFLAGS += $(LIBS) $(LDFLAGS_$@) $(LDNOSTDLIB) LDSCRIPT = $(call findfile,main_rel.ld,$(L4LIBDIR)) # install.inc eventually defines rules for every target -include $(L4DIR)/mk/install.inc +#include $(L4DIR)/mk/install.inc DEPS += $(foreach file,$(TARGET), $(dir $(file)).$(notdir $(file)).d) diff --git a/libdde_linux26/mk/subdir.mk b/libdde_linux26/mk/subdir.mk index 0f31b2d1..176200fe 100644 --- a/libdde_linux26/mk/subdir.mk +++ b/libdde_linux26/mk/subdir.mk @@ -6,18 +6,10 @@ # # 05/2002 Jork Loeser <jork.loeser@inf.tu-dresden.de> -include $(L4DIR)/mk/Makeconf +#include $(L4DIR)/mk/Makeconf -ifeq ($(PKGDIR),.) -TARGET ?= $(patsubst %/Makefile,%,$(wildcard $(addsuffix /Makefile, \ - idl include src lib server examples doc))) -$(if $(wildcard include/Makefile), idl lib server examples: include) -$(if $(wildcard idl/Makefile), lib server examples: idl) -$(if $(wildcard lib/Makefile), server examples: lib) -else TARGET ?= $(patsubst %/Makefile,%,$(wildcard $(addsuffix /Makefile, \ idl src lib server examples doc))) -endif SUBDIR_TARGET := $(if $(filter doc,$(MAKECMDGOALS)),$(TARGET), \ $(filter-out doc,$(TARGET))) |