aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile18
-rw-r--r--Makefile.common20
2 files changed, 25 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index d8c0cad0de..0c7fd370d0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,18 @@
# $Header$
CXX = c++
+AR = ar cru
+RANLIB = ranlib
+RM = rm -f
+MKDIR = mkdir -p
+ECHO = echo -n
+CAT = cat
+RM = rm -f
+# recursive version of RM
+RM_REC = $(RM) -r
+ZIP = zip -q
+CP = cp
+
CFLAGS = -g -O -Wall -Wstrict-prototypes -Wuninitialized -Wno-long-long -Wno-multichar
DEFINES =
LDFLAGS :=
@@ -29,9 +41,9 @@ CPPFLAGS= $(DEFINES) $(INCLUDES)
include Makefile.common
dist:
- rm -f $(ZIPFILE)
- zip -q $(ZIPFILE) $(DISTFILES)
+ $(RM) $(ZIPFILE)
+ $(ZIP) $(ZIPFILE) $(DISTFILES)
# Until we add a nice configure tool, default to the SDL build rules
build.rules:
- cp backends/sdl/build.rules build.rules
+ $(CP) backends/sdl/build.rules build.rules
diff --git a/Makefile.common b/Makefile.common
index 5636e64e77..96fb846bf4 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -39,15 +39,15 @@ scummvm$(EXEEXT): $(OBJS)
$(CXX) $(LDFLAGS) -o $(@) $(OBJS) $(LIBS)
scumm/libscumm.a: $(SCUMM_OBJS)
- ar cru $@ $+
- ranlib $@
+ $(AR) $@ $+
+ $(RANLIB) $@
simon/libsimon.a: $(SIMON_OBJS)
- ar cru $@ $+
- ranlib $@
+ $(AR) $@ $+
+ $(RANLIB) $@
clean:
- rm -f $(OBJS) $(SCUMM_OBJS) $(SIMON_OBJS) scummvm$(EXEEXT)
+ $(RM) $(OBJS) $(SCUMM_OBJS) $(SIMON_OBJS) scummvm$(EXEEXT)
.PHONY: all clean dist distclean
@@ -64,13 +64,13 @@ DEPDIRS = $(patsubst %,%/$(DEPDIR),$(MODULES))
DEPFILES = $(wildcard $(patsubst %,%/$(DEPDIR)/*.d,$(MODULES)))
.cpp.o:
- mkdir -p $(*D)/$(DEPDIR)
+ $(MKDIR) $(*D)/$(DEPDIR)
$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d2" $(CFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
- echo -n "$(*D)/" > $(*D)/$(DEPDIR)/$(*F).d
- cat "$(*D)/$(DEPDIR)/$(*F).d2" >> "$(*D)/$(DEPDIR)/$(*F).d"
- rm -f "$(*D)/$(DEPDIR)/$(*F).d2"
+ $(ECHO) "$(*D)/" > $(*D)/$(DEPDIR)/$(*F).d
+ $(CAT) "$(*D)/$(DEPDIR)/$(*F).d2" >> "$(*D)/$(DEPDIR)/$(*F).d"
+ $(RM) "$(*D)/$(DEPDIR)/$(*F).d2"
-include $(DEPFILES) /dev/null
distclean: clean
- rm -rf $(DEPDIRS)
+ $(RM_REC) $(DEPDIRS)