2005-02-08 15:13:27 +00:00
|
|
|
# -*- Makefile -*-
|
|
|
|
|
2005-03-11 09:50:32 +00:00
|
|
|
ifndef V
|
|
|
|
SILENT=@
|
|
|
|
endif
|
2006-10-28 22:42:16 +00:00
|
|
|
PRINTS=$(SILENT)$(call info,$(1))
|
2005-03-11 09:50:32 +00:00
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
$(OBJDIR)/%.o: %.c
|
2006-10-22 00:21:57 +00:00
|
|
|
$(SILENT)mkdir -p $(dir $@)
|
2006-10-27 21:48:06 +00:00
|
|
|
$(call PRINTS,CC $<)$(CC) $(CFLAGS) -c $< -o $@
|
2004-09-22 08:58:50 +00:00
|
|
|
|
|
|
|
$(OBJDIR)/%.o: %.S
|
2006-10-22 00:21:57 +00:00
|
|
|
$(SILENT)mkdir -p $(dir $@)
|
2006-10-27 21:48:06 +00:00
|
|
|
$(call PRINTS,CC $<)$(CC) $(CFLAGS) -c $< -o $@
|
2004-09-22 08:58:50 +00:00
|
|
|
|
2005-05-19 08:51:52 +00:00
|
|
|
# The echo stuff last in the dep update shell magic is to prevent any compiler
|
|
|
|
# errors/warnings to cause an error code to get returned and thus stop the
|
|
|
|
# build
|
|
|
|
#
|
|
|
|
# This script checks for the presence of $(BUILDDIR)/lang.h and if it doesn't
|
|
|
|
# alreay exist, it is created. This is because lots of files include this
|
|
|
|
# *generated* file and if it doesn't exist when we generate the deps it is no
|
|
|
|
# good. There's a -MG compiler option to cover for this case, but it doesn't
|
|
|
|
# play nicely into this as it then adds a dependency to the lang.h file
|
|
|
|
# without the proper path.
|
|
|
|
#
|
2004-09-22 08:58:50 +00:00
|
|
|
$(DEPFILE): $(SOURCES)
|
2006-10-22 00:21:57 +00:00
|
|
|
$(SILENT)mkdir -p $(dir $(DEPFILE))
|
2005-03-11 09:50:32 +00:00
|
|
|
$(SILENT)rm -f $(DEPFILE)
|
2006-02-09 04:27:57 +00:00
|
|
|
$(SILENT)(for each in $(SOURCES) x; do \
|
|
|
|
if test "$$each" = "credits.c"; then \
|
|
|
|
del="$$del$(BUILDDIR)/credits.raw"; \
|
|
|
|
touch $(BUILDDIR)/credits.raw; \
|
|
|
|
fi; \
|
|
|
|
if test "x" != "$$each"; then \
|
|
|
|
obj=`echo $$each | sed -e 's/\.[cS]/.o/'`; \
|
|
|
|
$(CC) -MG -MM -MT "$(OBJDIR)/$$obj" $(CFLAGS) $$each 2>/dev/null; \
|
|
|
|
fi; \
|
|
|
|
if test -n "$$del"; then \
|
|
|
|
rm $$del; \
|
|
|
|
del=""; \
|
|
|
|
fi \
|
|
|
|
done | sed -e "s:[^[:space:]]*lang.h:$(OBJDIR)/lang.o:" > $(DEPFILE); \
|
|
|
|
echo "oo" > /dev/null )
|
2004-09-22 08:58:50 +00:00
|
|
|
|
|
|
|
tags:
|
2005-03-11 09:50:32 +00:00
|
|
|
$(SILENT)(for d in $(DIRS); do \
|
2004-09-22 08:58:50 +00:00
|
|
|
etags -o $(OBJDIR)/TAGS -a $$d/*.[ch]; \
|
|
|
|
done)
|