blob: 4bb5ffcbeae3384df02d80152c2e086375d3e3d5 [file] [log] [blame]
Jim Bankoski9e033332010-10-15 19:50:141RM := rm -rf
2
3# All of the sources participating in the build are defined here
4CPP_SRCS := \
5grabcompressandsend.cpp \
6receivedecompressandplay.cpp
7
8C_SRCS := \
9time.c \
10vpx_network.c
11
12OBJS := \
13time.o \
14vpx_network.o
15
16CPP_DEPS := \
17./grabcompressandsend.d \
18./receivedecompressandplay.d
19
20C_DEPS := \
21./time.d \
22./vpx_network.d
23
24UNAME := $(shell uname)
25
26ifeq ($(UNAME), Linux)
James Zern059ab722010-10-16 00:06:1027 C_FLAGS = -DLINUX -O0 -g3 -Wall -c -fmessage-length=0 -m64 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)"
Jim Bankoski9e033332010-10-15 19:50:1428 RLIBS := -lvpx -lpthread -lrt -lSDL
29 SLIBS := -lvpx -lpthread -lrt
30 L_FLAGS := -m64
31else
32ifeq ($(UNAME), Darwin)
James Zern059ab722010-10-16 00:06:1033 C_FLAGS = -DLINUX -DMACOSX -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)"
Jim Bankoski9e033332010-10-15 19:50:1434 RLIBS := -lvpx -lpthread -lSDL -lpthread -lSDLmain -framework cocoa
35 SLIBS := -framework Carbon -framework QuartzCore -framework QuickTime -lvpx -lpthread -framework cocoa -lvidcap
36 L_FLAGS := -D_THREAD_SAFE
37else
James Zern059ab722010-10-16 00:06:1038ifneq ($(findstring CYGWIN, $(UNAME)),)
39 C_FLAGS = -DLINUX -DMACOSX -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)"
Jim Bankoski9e033332010-10-15 19:50:1440 RLIBS := -lvpx -lpthread -lrt -lSDL
41 SLIBS := -lvpx -lpthread -lrt -lvidcap
42 L_FLAGS :=
43else
James Zern059ab722010-10-16 00:06:1044 $(error Unknown System need to fix this make file!)
Jim Bankoski9e033332010-10-15 19:50:1445endif
46endif
47endif
48EXECUTABLES := grabcompressandsend receivedecompressandplay
49
50
51# Each subdirectory must supply rules for building sources it contributes
52%.o: %.cpp
53@echo 'Building file: $<'
54@echo 'Invoking: GCC C++ Compiler'
55g++ $(C_FLAGS) -o"$@" "$<"
56@echo 'Finished building: $<'
57@echo ' '
58
59%.o: %.c
60@echo 'Building file: $<'
61@echo 'Invoking: GCC C Compiler'
62gcc $(C_FLAGS) -o"$@" "$<"
63@echo 'Finished building: $<'
64@echo ' '
65
66
67
68# Add inputs and outputs from these tool invocations to the build variables
69
70# All Target
71all: grabcompressandsend receivedecompressandplay
72
73# Tool invocations
74grabcompressandsend: $(OBJS) $(USER_OBJS) ./grabcompressandsend.o
75@echo 'Building target: $@'
76@echo 'Invoking: GCC C++ Linker'
77@echo g++ $(L_FLAGS) -o "grabcompressandsend" ./grabcompressandsend.o $(OBJS) $(SLIBS)
78g++ $(L_FLAGS) -o "grabcompressandsend" ./grabcompressandsend.o $(OBJS) $(SLIBS)
79@echo 'Finished building target: $@'
80@echo ' '
81
82receivedecompressandplay: $(OBJS) $(USER_OBJS) ./receivedecompressandplay.o
83@echo 'Building target: $@'
84@echo 'Invoking: GCC C++ Linker'
85g++ $(L_FLAGS) -o "receivedecompressandplay" ./receivedecompressandplay.o $(OBJS) $(RLIBS)
86@echo 'Finished building target: $@'
87@echo ' '
88
89
90# Other Targets
91clean:
92-$(RM) $(OBJS) $(C_DEPS) $(CPP_DEPS) $(EXECUTABLES) receivedecompressandplay.o grabcompressandsend.o
93-@echo ' '
94
95