makefiles-garage/bintools/checklib/Makefile
changeset 1 820b22e13ff1
parent 0 37428ad74fc2
--- a/makefiles-garage/bintools/checklib/Makefile	Mon Nov 16 10:04:44 2009 +0000
+++ b/makefiles-garage/bintools/checklib/Makefile	Fri Jan 08 16:16:51 2010 +0000
@@ -11,16 +11,56 @@
 # Contributors:
 #
 # Description:
-# This is a Linux makefile for checklib. 
-
+# This is a Linux makefile for checklib.
 
 ifdef EPOCROOT
 include $(EPOCROOT)/build/makefiles-garage/global-make-env.mk
 else
 $(error EPOCROOT must be defined as the parent directory of your epoc32 tree)
 endif
+
+cpp_inc_paths = -I . -I object/coff -I ..
+
+lib_opts =
+
+exe = checklib
+
+CPPFLAGS = $(cpp_inc_paths) $(global_cpp_flags)
+LDFLAGS = $(lib_opts) $(global_ld_flags)
+
+prereqs =
+
+srcs = main.cpp \
+library/library.cpp \
+misc/endian.cpp \
+object/object.cpp \
+object/elf_object.cpp \
+object/coff_object.cpp \
+object/elf/elf_file_header.cpp \
+object/elf/elf_section_header.cpp \
+object/elf/elf_symbol.cpp \
+object/elf/elf_string_table.cpp \
+object/coff/coff_file_header.cpp \
+object/coff/coff_symbol.cpp \
+object/coff/coff_string_table.cpp
 
-todo_target = checklib
-include $(EPOCROOT)/build/makefiles-garage/todo.mk
-all: todo
+
+.PHONY: all clean $(prereqs)
+
+all: $(exe)
+
+bases = $(basename $(srcs))
+
+objs = $(addsuffix .o,$(bases))
 
+$(prereqs): $(global_prereqs)
+	$(MAKE) -C $(EPOCROOT)/build $@
+
+$(objs): $(prereqs)
+ 
+$(exe): $(objs)
+	$(CC) -o $@ $(objs) $(LDFLAGS)
+
+clean:
+	rm -f $(objs) $(exe)
+