From 31d66d5fb2961c4c2df0d9f415f91ee5405f8d19 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 24 Oct 2012 16:46:12 +0000 Subject: Add framework to support loadable ELF modules (not much logic in place yet) git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5250 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/binfmt/Makefile | 55 +++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 28 deletions(-) (limited to 'nuttx/binfmt/Makefile') diff --git a/nuttx/binfmt/Makefile b/nuttx/binfmt/Makefile index b3a9269b3..1b98e3ede 100644 --- a/nuttx/binfmt/Makefile +++ b/nuttx/binfmt/Makefile @@ -1,7 +1,7 @@ ############################################################################ # nxflat/Makefile # -# Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. +# Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -36,55 +36,54 @@ -include $(TOPDIR)/Make.defs ifeq ($(WINTOOL),y) -INCDIROPT = -w +INCDIROPT = -w endif -CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/sched} +CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/sched} -ifeq ($(CONFIG_NXFLAT),y) -include libnxflat/Make.defs -LIBNXFLAT_CSRCS += nxflat.c -endif +# Basic BINFMT source files BINFMT_ASRCS = BINFMT_CSRCS = binfmt_globals.c binfmt_register.c binfmt_unregister.c \ - binfmt_loadmodule.c binfmt_unloadmodule.c binfmt_execmodule.c \ - binfmt_exec.c binfmt_dumpmodule.c + binfmt_loadmodule.c binfmt_unloadmodule.c binfmt_execmodule.c \ + binfmt_exec.c binfmt_dumpmodule.c -SYMTAB_ASRCS = -SYMTAB_CSRCS = symtab_findbyname.c symtab_findbyvalue.c \ - symtab_findorderedbyname.c symtab_findorderedbyvalue.c +# Symbol table source files -SUBDIRS = libnxflat +BINFMT_CSRCS += symtab_findbyname.c symtab_findbyvalue.c \ + symtab_findorderedbyname.c symtab_findorderedbyvalue.c -ASRCS = $(BINFMT_ASRCS) $(SYMTAB_ASRCS) $(LIBNXFLAT_ASRCS) -AOBJS = $(ASRCS:.S=$(OBJEXT)) +# Add configured binary modules -CSRCS = $(BINFMT_CSRCS) $(SYMTAB_CSRCS) $(LIBNXFLAT_CSRCS) -COBJS = $(CSRCS:.c=$(OBJEXT)) +VPATH = +SUBDIRS = + +include libnxflat/Make.defs +include libelf/Make.defs -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) +BINFMT_AOBJS = $(BINFMT_ASRCS:.S=$(OBJEXT)) +BINFMT_COBJS = $(BINFMT_CSRCS:.c=$(OBJEXT)) -BIN = libbinfmt$(LIBEXT) +BINFMT_SRCS = $(BINFMT_ASRCS) $(BINFMT_CSRCS) +BINFMT_OBJS = $(BINFMT_AOBJS) $(BINFMT_COBJS) -VPATH = libnxflat +BIN = libbinfmt$(LIBEXT) -all: $(BIN) +all: $(BIN) -$(AOBJS): %$(OBJEXT): %.S +$(BINFMT_AOBJS): %$(OBJEXT): %.S $(call ASSEMBLE, $<, $@) -$(COBJS): %$(OBJEXT): %.c +$(BINFMT_COBJS): %$(OBJEXT): %.c $(call COMPILE, $<, $@) -$(BIN): $(OBJS) - @( for obj in $(OBJS) ; do \ +$(BIN): $(BINFMT_OBJS) + @( for obj in $(BINFMT_OBJS) ; do \ $(call ARCHIVE, $@, $${obj}); \ done ; ) -.depend: Makefile $(SRCS) +.depend: Makefile $(BINFMT_SRCS) @$(MKDEP) --dep-path . --dep-path libnxflat \ - $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep + $(CC) -- $(CFLAGS) -- $(BINFMT_SRCS) >Make.dep @touch $@ depend: .depend -- cgit v1.2.3