Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic files for building common-c
- Loading branch information
Showing
4 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
VALID_TOOLCHAINS := newlib pnacl | ||
|
||
TARGET = moonlight-chrome | ||
|
||
include $(NACL_SDK_ROOT)/tools/common.mk | ||
|
||
# Include Moonlight-Common-C makefile | ||
include common-c.mk | ||
|
||
LIBS = ppapi pthread | ||
|
||
CFLAGS = -Wall -Wno-missing-braces | ||
SOURCES = \ | ||
$(COMMON_C_SOURCE) \ | ||
libchelper.c \ | ||
|
||
# Build rules generated by macros from common.mk: | ||
|
||
$(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),$(CFLAGS)))) | ||
|
||
# The PNaCl workflow uses both an unstripped and finalized/stripped binary. | ||
# On NaCl, only produce a stripped binary for Release configs (not Debug). | ||
ifneq (,$(or $(findstring pnacl,$(TOOLCHAIN)),$(findstring Release,$(CONFIG)))) | ||
$(eval $(call LINK_RULE,$(TARGET)_unstripped,$(SOURCES),$(LIBS),$(DEPS))) | ||
$(eval $(call STRIP_RULE,$(TARGET),$(TARGET)_unstripped)) | ||
else | ||
$(eval $(call LINK_RULE,$(TARGET),$(SOURCES),$(LIBS),$(DEPS))) | ||
endif | ||
|
||
$(eval $(call NMF_RULE,$(TARGET),)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
COMMON_C_DIR := moonlight-common-c/limelight-common | ||
OPENAES_DIR := $(COMMON_C_DIR)/OpenAES | ||
|
||
OPENAES_SOURCE := \ | ||
$(OPENAES_DIR)/oaes_base64.c \ | ||
$(OPENAES_DIR)/oaes_lib.c \ | ||
|
||
OPENAES_INCLUDE := $(OPENAES_DIR) | ||
|
||
COMMON_C_SOURCE := \ | ||
$(COMMON_C_DIR)/AudioStream.c \ | ||
$(COMMON_C_DIR)/ByteBuffer.c \ | ||
$(COMMON_C_DIR)/Connection.c \ | ||
$(COMMON_C_DIR)/ControlStream.c \ | ||
$(COMMON_C_DIR)/FakeCallbacks.c \ | ||
$(COMMON_C_DIR)/InputStream.c \ | ||
$(COMMON_C_DIR)/LinkedBlockingQueue.c \ | ||
$(COMMON_C_DIR)/Misc.c \ | ||
$(COMMON_C_DIR)/Platform.c \ | ||
$(COMMON_C_DIR)/PlatformSockets.c \ | ||
$(COMMON_C_DIR)/RtpReorderQueue.c \ | ||
$(COMMON_C_DIR)/RtspConnection.c \ | ||
$(COMMON_C_DIR)/RtspParser.c \ | ||
$(COMMON_C_DIR)/SdpGenerator.c \ | ||
$(COMMON_C_DIR)/VideoDepacketizer.c \ | ||
$(COMMON_C_DIR)/VideoStream.c \ | ||
$(OPENAES_SOURCE) \ | ||
|
||
COMMON_C_INCLUDE := $(COMMON_C_DIR) $(OPENAES_INCLUDE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include <sys/timeb.h> | ||
#include <sys/time.h> | ||
|
||
// This function is defined but not implemented by newlib | ||
int ftime(struct timeb *tp) { | ||
struct timeval tv; | ||
|
||
if (gettimeofday(&tv, NULL) < 0) { | ||
return -1; | ||
} | ||
|
||
tp->time = tv.tv_sec; | ||
tp->millitm = tv.tv_usec / 1000; | ||
tp->timezone = 0; | ||
tp->dstflag = 0; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@%NACL_SDK_ROOT%\tools\make.exe %* |