raze-gles/polymer/eduke32/source/enet/Makefile
hendricks266 f51bdc2faa Slight makefile reorganization and cleanup.
* Centralize optimization strategies in Makefile.common. This required moving detection of $(PLATFORM), which makes sense if we work on the paradigm that Makefile.common is for generic compiler setup and Makefile.shared works with libraries and things closer to the engine and game code itself.
* New Makefile variables OPTOPT (Optimization Options) and CUSTOMOPT (Custom Optimizations). OPTOPT by default contains -march, -mtune, etc. Setting this variable from Make invocation will blank these. CUSTOMOPT (Custom Optimizations) works the same but in an additive fashion, overwriting nothing. Technically CUSTOMOPT could stand for (Custom Options) and include any additional parameters sent to both linker and compiler.
* Factor out literal names of the main executables.
* The build process now prints assembler (if NOASM=0) and linker settings in addition to compiler settings.

git-svn-id: https://svn.eduke32.com/eduke32@3096 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-29 04:26:25 +00:00

54 lines
1.1 KiB
Makefile

include ../../Makefile.common
include ../../$(EROOT)/Makefile.shared
OBJ=obj
OBJNAME=libenet.a
SRC=src
INC=include
# for BUILD_ECHOFLAGS:
OURCFLAGS=$(BASECFLAGS) $(BUILDCFLAGS) -I$(INC) -I$(SRC) -I../../$(EROOT)/include
ifneq ($(RELEASE),0)
# Debugging disabled
debug+= $(F_NO_STACK_PROTECTOR)
endif
OURCONLYFLAGS=$(BASECONLYFLAGS)
OURCXXFLAGS=$(BASECXXFLAGS)
OURLDFLAGS=$(BASELDFLAGS)
OURASFLAGS=$(BASEASFLAGS)
OBJECTS=$(OBJ)/callbacks.o \
$(OBJ)/host.o \
$(OBJ)/list.o \
$(OBJ)/packet.o \
$(OBJ)/peer.o \
$(OBJ)/protocol.o \
$(OBJ)/compress.o
ifeq ($(PLATFORM),WINDOWS)
OBJECTS+= $(OBJ)/win32.o
OBJNAME=libenet_win32.a
OBJ=obj_win
else
OBJECTS+= $(OBJ)/unix.o
endif
# OBJECTS=$(SOURCES:%.c=$(OBJ)/%.o)
$(OBJNAME): $(OBJECTS)
$(BUILD_ECHOFLAGS)
$(ARCHIVE_STATUS)
if $(AR) cr $@ $^; then $(ARCHIVE_OK); else $(ARCHIVE_FAILED); fi
$(OBJECTS): $(OBJ)/%.o: $(SRC)/%.c $(INC)/enet/*.h
-mkdir -p $(OBJ)
$(COMPILE_STATUS)
if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
ifeq ($(PRETTY_OUTPUT),1)
.SILENT:
endif
.PHONY: clean
clean:
-rm -f $(OBJECTS) $(OBJNAME)