diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2007-12-13 16:18:53 +0900 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2007-12-19 14:50:07 +0900 |
commit | adf85cbc1756e56c1f52f56235a3c08b3c5b8e05 (patch) | |
tree | 480e2d89501d7e51f3c7abf3291930932c3a3371 /util_lib | |
parent | ac12ceecf15f637e024e6be9a030497e732a74eb (diff) |
Build system simplification/standardisation
This change makes kexec-tools work more like a standard configure-make-
make-install-type project:
* Remove $(OBJDIR) stuff. To do an out-of-tree build, just configure
from a different directory.
* Use the implicit Makefile rules more, and just edit the compiler
flags for specific targets.
* Simplify compiler/linker flags - no need for EXTRA_*
* Add TARGET_CC, and improve checks for BUILD_CC too.
* Set arch-specific flags in arch-specific makefiles, not conditional
on $(ARCH).
* Generate dependency files in the main compile, rather than as a
separate step.
* Don't #include sha256.c, but re-build it into the purgatory.
Still a work-in-progress.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'util_lib')
-rw-r--r-- | util_lib/Makefile | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/util_lib/Makefile b/util_lib/Makefile index 75cde25..f7a7d82 100644 --- a/util_lib/Makefile +++ b/util_lib/Makefile @@ -3,26 +3,15 @@ # UTIL_LIB_SRCS:=util_lib/compute_ip_checksum.c UTIL_LIB_SRCS+=util_lib/sha256.c -UTIL_LIB_OBJS:=$(patsubst %.c, $(OBJDIR)/%.o, $(UTIL_LIB_SRCS)) -UTIL_LIB_DEPS:=$(patsubst %.c, $(OBJDIR)/%.d, $(UTIL_LIB_SRCS)) -UTIL_LIB:=$(OBJDIR)/libutil.a +UTIL_LIB_OBJS:=$(patsubst %.c, %.o, $(UTIL_LIB_SRCS)) +UTIL_LIB_DEPS:=$(patsubst %.c, %.d, $(UTIL_LIB_SRCS)) +UTIL_LIB:=libutil.a -include $(UTIL_LIB_DEPS) +-include $(UTIL_LIB_DEPS) -$(UTIL_LIB_DEPS): $(OBJDIR)/%.d: %.c - $(MKDIR) -p $(@D) - $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -M $< | sed -e 's|$(patsubst %.d,%.o,$(@F))|$(patsubst %.d,%.o,$(@))|' > $@ - -# sha256.c needs to be compiled without optimization, else -# purgatory fails to execute (on ia64 at least). -# By placing -O0 after $(CFLAGS), which is provided by -# the prevailing environment, it overrides any other -O flags -# provided. -$(UTIL_LIB_OBJS): $(OBJDIR)/%.o: %.c $(OBJDIR)/%.d - $(MKDIR) -p $(@D) - $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -O0 -c -o $@ $< +$(UTIL_LIB): CPPFLAGS += -I$(srcdir)/util_lib/include $(UTIL_LIB): $(UTIL_LIB_OBJS) - $(MKDIR) -p $(@D) + @$(MKDIR) -p $(@D) $(AR) rs $(UTIL_LIB) $(UTIL_LIB_OBJS) |