changed global animations (esp. toons) to be controlled by game mode
[rocksndiamonds.git] / src / Makefile
index 0f8c0997fe9dcff77db7005332cc9ce10e8a5f1a..6e9bd2bc91b2c1e4197e02266a63895505703a08 100644 (file)
@@ -117,6 +117,8 @@ OPTIONS = $(DEBUG) -Wall                    # only for debugging purposes
 # OPTIONS = -O3
 
 ifdef BUILD_DIST                       # distribution build
+SYS_LDFLAGS := $(shell echo $(SYS_LDFLAGS) |   \
+                      sed -e "s%-rpath,[^ ]*%-rpath,'\$$ORIGIN/lib'%")
 OPTIONS = -O3 -Wall
 endif
 
@@ -213,6 +215,9 @@ all: $(AUTOCONF) libgame_dir game_em_dir game_sp_dir $(PROGNAME) graphics_dir
 
 $(PROGNAME): $(RNDLIBS) $(TIMESTAMP_FILE) $(OBJS) $(ICON)
        $(CC) $(PROFILING) $(OBJS) $(ICON) $(RNDLIBS) $(LDFLAGS) -o $(PROGNAME)
+ifdef BUILD_DIST
+       strip $(PROGNAME)
+endif
 
 libgame_dir:
        @$(MAKE) -C $(LIBGAME_DIR)
@@ -265,7 +270,7 @@ $(ICON):
        $(CC) $(PROFILING) $(CFLAGS) -c $*.c
 
 graphics_dir:
-       @$(MAKE) -C $(GRAPHICS_DIR)
+       @test -f $(GRAPHICS_DIR)/Makefile && $(MAKE) -C $(GRAPHICS_DIR) || true
 
 clean-obj:
        $(MAKE) -C $(LIBGAME_DIR) clean
@@ -273,9 +278,6 @@ clean-obj:
        $(MAKE) -C $(GAME_SP_DIR) clean
        $(RM) $(OBJS)
        $(RM) $(RNDLIBS)
-#      $(RM) $(LIBGAME)
-#      $(RM) $(GAME_EM)
-#      $(RM) $(GAME_SP)
 
 clean-ico:
        $(RM) $(ICONBASE).ico
@@ -290,6 +292,8 @@ clean: clean-obj clean-ico clean-bin
 clean-git: clean auto-conf-clean
        @$(MAKE) -C $(GRAPHICS_DIR) clean
 
+dist-clean: clean-obj clean-ico
+
 
 # -----------------------------------------------------------------------------
 # run and test targets
@@ -309,8 +313,6 @@ valgrind:
 # development only
 # -----------------------------------------------------------------------------
 
-dist-clean: clean-obj
-
 tags:
        $(ETAGS) *.[ch] $(LIBGAME_DIR)/*.[ch] $(GAME_EM_DIR)/*.[ch] $(GAME_SP_DIR)/*.[ch]