2005-02-08 15:13:27 +00:00
|
|
|
# -*- Makefile -*-
|
|
|
|
|
2005-03-11 09:50:32 +00:00
|
|
|
ifndef V
|
|
|
|
SILENT=@
|
|
|
|
endif
|
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
$(OBJDIR)/%.o: %.c
|
2005-03-11 09:50:32 +00:00
|
|
|
$(SILENT)mkdir -p `dirname $@`
|
2004-09-22 08:58:50 +00:00
|
|
|
@echo "CC $<"
|
2005-03-11 09:50:32 +00:00
|
|
|
$(SILENT)$(CC) $(CFLAGS) -c $< -o $@
|
2004-09-22 08:58:50 +00:00
|
|
|
|
|
|
|
$(OBJDIR)/%.o: %.S
|
2005-03-11 09:50:32 +00:00
|
|
|
$(SILENT)mkdir -p `dirname $@`
|
2004-09-22 08:58:50 +00:00
|
|
|
@echo "CC $<"
|
2005-03-11 09:50:32 +00:00
|
|
|
$(SILENT)$(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)
|
2005-05-07 22:41:17 +00:00
|
|
|
$(SILENT)mkdir -p `dirname $(DEPFILE)`
|
2005-03-11 09:50:32 +00:00
|
|
|
$(SILENT)rm -f $(DEPFILE)
|
2005-05-19 08:51:52 +00:00
|
|
|
$(SILENT)(if test ! -f $(BUILDDIR)/lang.h; then \
|
2006-01-16 22:45:44 +00:00
|
|
|
del="$(BUILDDIR)/lang.h"; \
|
2005-05-19 08:51:52 +00:00
|
|
|
touch $(BUILDDIR)/lang.h; \
|
|
|
|
fi; \
|
|
|
|
for each in $(SOURCES) x; do \
|
2006-01-16 22:45:44 +00:00
|
|
|
if test "$$each" = "credits.c"; then \
|
|
|
|
del="$$del$(BUILDDIR)/credits.raw"; \
|
|
|
|
touch $(BUILDDIR)/credits.raw; \
|
|
|
|
fi; \
|
2004-10-08 09:20:21 +00:00
|
|
|
if test "x" != "$$each"; then \
|
|
|
|
obj=`echo $$each | sed -e 's/\.[cS]/.o/'`; \
|
|
|
|
$(CC) -MM -MT "$(OBJDIR)/$$obj" $(CFLAGS) $$each >> $(DEPFILE) 2>/dev/null; \
|
|
|
|
fi; \
|
2006-01-16 22:45:44 +00:00
|
|
|
if test -n "$$del"; then \
|
|
|
|
rm $$del; \
|
|
|
|
del=""; \
|
|
|
|
fi \
|
2004-09-22 21:39:41 +00:00
|
|
|
done; \
|
|
|
|
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)
|