2010-12-19 22:29:01 +00:00
|
|
|
include ../../Makefile.common
|
|
|
|
include ../../$(EROOT)/Makefile.shared
|
|
|
|
|
2009-12-05 09:22:43 +00:00
|
|
|
OBJ=obj
|
2010-12-19 22:29:01 +00:00
|
|
|
OBJNAME=libenet.a
|
2009-12-05 09:22:43 +00:00
|
|
|
SRC=src
|
2010-06-22 21:50:01 +00:00
|
|
|
INC=include
|
2009-12-05 09:22:43 +00:00
|
|
|
|
2010-12-19 22:29:01 +00:00
|
|
|
# for BUILD_ECHOFLAGS:
|
2012-11-06 07:49:44 +00:00
|
|
|
OURCOMMONFLAGS=$(BASECOMMONFLAGS) $(BUILDCOMMONFLAGS) -I$(INC) -I$(SRC) -I../../$(EROOT)/include
|
2012-03-23 20:22:10 +00:00
|
|
|
ifneq ($(RELEASE),0)
|
|
|
|
# Debugging disabled
|
|
|
|
debug+= $(F_NO_STACK_PROTECTOR)
|
|
|
|
endif
|
2012-11-06 07:49:44 +00:00
|
|
|
OURCFLAGS=$(OURCOMMONFLAGS) $(BASECFLAGS)
|
2012-03-12 04:48:42 +00:00
|
|
|
OURCONLYFLAGS=$(BASECONLYFLAGS)
|
|
|
|
OURCXXFLAGS=$(BASECXXFLAGS)
|
2012-11-06 07:49:44 +00:00
|
|
|
PRINTLDFLAGS=$(BASELDFLAGS)
|
2012-10-29 04:26:25 +00:00
|
|
|
OURASFLAGS=$(BASEASFLAGS)
|
2009-12-05 09:22:43 +00:00
|
|
|
|
2012-11-06 07:49:44 +00:00
|
|
|
COMPILER=$(CC) $(OURCONLYFLAGS)
|
2012-11-05 02:49:08 +00:00
|
|
|
ifneq ($(CPLUSPLUS),0)
|
2012-11-06 07:49:44 +00:00
|
|
|
COMPILER=$(CXX) $(OURCXXFLAGS)
|
2012-11-05 02:49:08 +00:00
|
|
|
endif
|
|
|
|
|
2010-12-19 22:29:01 +00:00
|
|
|
|
2009-12-05 09:22:43 +00:00
|
|
|
OBJECTS=$(OBJ)/callbacks.o \
|
|
|
|
$(OBJ)/host.o \
|
|
|
|
$(OBJ)/list.o \
|
|
|
|
$(OBJ)/packet.o \
|
|
|
|
$(OBJ)/peer.o \
|
2010-06-22 21:50:01 +00:00
|
|
|
$(OBJ)/protocol.o \
|
|
|
|
$(OBJ)/compress.o
|
2009-12-05 09:22:43 +00:00
|
|
|
|
|
|
|
ifeq ($(PLATFORM),WINDOWS)
|
2010-12-19 22:29:01 +00:00
|
|
|
OBJECTS+= $(OBJ)/win32.o
|
|
|
|
OBJNAME=libenet_win32.a
|
|
|
|
OBJ=obj_win
|
2009-12-05 09:22:43 +00:00
|
|
|
else
|
2010-12-19 22:29:01 +00:00
|
|
|
OBJECTS+= $(OBJ)/unix.o
|
2009-12-05 09:22:43 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
# OBJECTS=$(SOURCES:%.c=$(OBJ)/%.o)
|
|
|
|
|
|
|
|
$(OBJNAME): $(OBJECTS)
|
2010-12-19 22:29:01 +00:00
|
|
|
$(BUILD_ECHOFLAGS)
|
|
|
|
$(ARCHIVE_STATUS)
|
|
|
|
if $(AR) cr $@ $^; then $(ARCHIVE_OK); else $(ARCHIVE_FAILED); fi
|
2009-12-05 09:22:43 +00:00
|
|
|
|
2010-06-22 21:50:01 +00:00
|
|
|
$(OBJECTS): $(OBJ)/%.o: $(SRC)/%.c $(INC)/enet/*.h
|
2009-12-05 09:22:43 +00:00
|
|
|
-mkdir -p $(OBJ)
|
|
|
|
$(COMPILE_STATUS)
|
2012-11-06 07:49:44 +00:00
|
|
|
if $(COMPILER) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2010-08-17 20:00:44 +00:00
|
|
|
|
2009-12-05 09:22:43 +00:00
|
|
|
ifeq ($(PRETTY_OUTPUT),1)
|
|
|
|
.SILENT:
|
|
|
|
endif
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
-rm -f $(OBJECTS) $(OBJNAME)
|