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
|
|
|
|
#
|
2009-03-02 06:13:18 +00:00
|
|
|
# This script checks for the presence of $(BUILDDIR)/lang/lang.h and if it doesn't
|
2005-05-19 08:51:52 +00:00
|
|
|
# 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.
|
|
|
|
#
|
2008-02-18 12:17:34 +00:00
|
|
|
# The trailing sed hack for a range of files is present because how gcc works
|
|
|
|
# for generating dependencies when the include file doesn't exist. Then it
|
|
|
|
# makes the dependency without any path, and that breaks how things work for
|
|
|
|
# us. We thus add the correct path for a few generated files!
|
|
|
|
#
|
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 \
|
2009-03-02 06:13:18 +00:00
|
|
|
done | sed -e "s:[^[:space:]]*lang.h:$(OBJDIR)/lang/lang_core.o:" \
|
2008-02-18 12:17:34 +00:00
|
|
|
-e "s:[^[:space:]]*sysfont.h:$(BUILDDIR)/sysfont.h:" \
|
|
|
|
-e "s:[^[:space:]]*max_language_size.h:$(BUILDDIR)/max_language_size.h:" \
|
2008-11-03 14:37:50 +00:00
|
|
|
-e "s: bitmaps/: $(BUILDDIR)/bitmaps/:g" \
|
|
|
|
-e "s: pluginbitmaps/: $(BUILDDIR)/pluginbitmaps/:g" \
|
2008-02-18 12:17:34 +00:00
|
|
|
> $(DEPFILE); \
|
2006-02-09 04:27:57 +00:00
|
|
|
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)
|