--- ./lights/src/Makefile.orig Tue Oct 11 19:55:43 2005 +++ ./lights/src/Makefile Sun Dec 24 15:09:48 2006 @@ -1,27 +1,18 @@ -BUILD_DEBUG_DIR=debugi386 -BUILD_RELEASE_DIR=releasei386 +BUILD_DEBUG_DIR=debug +BUILD_RELEASE_DIR=release # this nice line comes from the linux kernel makefile ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc/ -e s/sparc64/sparc/ -e s/arm.*/arm/ -e s/sa110/arm/ -e s/alpha/axp/) -ifneq ($(ARCH),i386) -ifneq ($(ARCH),axp) -ifneq ($(ARCH),ppc) -ifneq ($(ARCH),sparc) -$(error arch $(ARCH) is currently not supported) +CC?=gcc +BASE_CFLAGS=-fcommon +RELEASE_CFLAGS=$(BASE_CFLAGS) -fomit-frame-pointer +ifeq ($(ARCH),i386) +RELEASE_CFLAGS+=-falign-functions=2 endif -endif -endif -endif - -CC=gcc -BASE_CFLAGS= -RELEASE_CFLAGS=$(BASE_CFLAGS) -O2 -fomit-frame-pointer \ - -fexpensive-optimizations -falign-loops=2 \ - -falign-jumps=2 -falign-functions=2 DEBUG_CFLAGS=$(BASE_CFLAGS) -g -LDFLAGS=-ldl -lm +LDFLAGS=-lm SHLIBEXT=so @@ -31,7 +23,7 @@ SHLIBLDFLAGS=-shared DO_CC=$(CC) $(CFLAGS) -o $@ -c $< DO_SHLIB_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $< -TARGETS=$(BUILDDIR)/lights/game$(ARCH).$(SHLIBEXT) \ +TARGETS=$(BUILDDIR)/lights/game.$(SHLIBEXT) \ all: @echo @@ -43,11 +35,11 @@ all: debug: @-mkdir -p $(BUILD_DEBUG_DIR)/lights/nav - $(MAKE) targets BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS="$(DEBUG_CFLAGS)" + $(MAKE) targets BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS+="$(DEBUG_CFLAGS)" release: @-mkdir -p $(BUILD_RELEASE_DIR)/lights/nav - $(MAKE) targets BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS="$(RELEASE_CFLAGS)" + $(MAKE) targets BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS+="$(RELEASE_CFLAGS)" targets: $(TARGETS) @@ -116,7 +108,7 @@ LIGHTS_OBJS = \ $(BUILDDIR)/scanner.o \ $(BUILDDIR)/q_shared.o -$(BUILDDIR)/lights/game$(ARCH).$(SHLIBEXT) : $(LIGHTS_OBJS) +$(BUILDDIR)/lights/game.$(SHLIBEXT) : $(LIGHTS_OBJS) $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(LIGHTS_OBJS) $(BUILDDIR)/acebot_ai.o : ace/acebot_ai.c @@ -310,10 +302,10 @@ $(BUILDDIR)/q_shared.o : q_shared.c clean: clean-debug clean-release clean-debug: - $(MAKE) clean2 BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS="$(DEBUG_CFLAGS)" + $(MAKE) clean2 BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS+="$(DEBUG_CFLAGS)" clean-release: - $(MAKE) clean2 BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS="$(DEBUG_CFLAGS)" + $(MAKE) clean2 BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS+="$(DEBUG_CFLAGS)" clean2: -rm -f $(LIGHTS_OBJS)