| Jim Bankoski | 9e03333 | 2010-10-15 19:50:14 | [diff] [blame] | 1 | RM := rm -rf |
| 2 | |
| 3 | # All of the sources participating in the build are defined here |
| 4 | CPP_SRCS := \ |
| 5 | grabcompressandsend.cpp \ |
| 6 | receivedecompressandplay.cpp |
| 7 | |
| 8 | C_SRCS := \ |
| 9 | time.c \ |
| 10 | vpx_network.c |
| 11 | |
| 12 | OBJS := \ |
| 13 | time.o \ |
| 14 | vpx_network.o |
| 15 | |
| 16 | CPP_DEPS := \ |
| 17 | ./grabcompressandsend.d \ |
| 18 | ./receivedecompressandplay.d |
| 19 | |
| 20 | C_DEPS := \ |
| 21 | ./time.d \ |
| 22 | ./vpx_network.d |
| 23 | |
| 24 | UNAME := $(shell uname) |
| 25 | |
| 26 | ifeq ($(UNAME), Linux) |
| James Zern | 059ab72 | 2010-10-16 00:06:10 | [diff] [blame] | 27 | C_FLAGS = -DLINUX -O0 -g3 -Wall -c -fmessage-length=0 -m64 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" |
| Jim Bankoski | 9e03333 | 2010-10-15 19:50:14 | [diff] [blame] | 28 | RLIBS := -lvpx -lpthread -lrt -lSDL |
| 29 | SLIBS := -lvpx -lpthread -lrt |
| 30 | L_FLAGS := -m64 |
| 31 | else |
| 32 | ifeq ($(UNAME), Darwin) |
| James Zern | 059ab72 | 2010-10-16 00:06:10 | [diff] [blame] | 33 | C_FLAGS = -DLINUX -DMACOSX -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" |
| Jim Bankoski | 9e03333 | 2010-10-15 19:50:14 | [diff] [blame] | 34 | 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 |
| 37 | else |
| James Zern | 059ab72 | 2010-10-16 00:06:10 | [diff] [blame] | 38 | ifneq ($(findstring CYGWIN, $(UNAME)),) |
| 39 | C_FLAGS = -DLINUX -DMACOSX -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" |
| Jim Bankoski | 9e03333 | 2010-10-15 19:50:14 | [diff] [blame] | 40 | RLIBS := -lvpx -lpthread -lrt -lSDL |
| 41 | SLIBS := -lvpx -lpthread -lrt -lvidcap |
| 42 | L_FLAGS := |
| 43 | else |
| James Zern | 059ab72 | 2010-10-16 00:06:10 | [diff] [blame] | 44 | $(error Unknown System need to fix this make file!) |
| Jim Bankoski | 9e03333 | 2010-10-15 19:50:14 | [diff] [blame] | 45 | endif |
| 46 | endif |
| 47 | endif |
| 48 | EXECUTABLES := 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' |
| 55 | g++ $(C_FLAGS) -o"$@" "$<" |
| 56 | @echo 'Finished building: $<' |
| 57 | @echo ' ' |
| 58 | |
| 59 | %.o: %.c |
| 60 | @echo 'Building file: $<' |
| 61 | @echo 'Invoking: GCC C Compiler' |
| 62 | gcc $(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 |
| 71 | all: grabcompressandsend receivedecompressandplay |
| 72 | |
| 73 | # Tool invocations |
| 74 | grabcompressandsend: $(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) |
| 78 | g++ $(L_FLAGS) -o "grabcompressandsend" ./grabcompressandsend.o $(OBJS) $(SLIBS) |
| 79 | @echo 'Finished building target: $@' |
| 80 | @echo ' ' |
| 81 | |
| 82 | receivedecompressandplay: $(OBJS) $(USER_OBJS) ./receivedecompressandplay.o |
| 83 | @echo 'Building target: $@' |
| 84 | @echo 'Invoking: GCC C++ Linker' |
| 85 | g++ $(L_FLAGS) -o "receivedecompressandplay" ./receivedecompressandplay.o $(OBJS) $(RLIBS) |
| 86 | @echo 'Finished building target: $@' |
| 87 | @echo ' ' |
| 88 | |
| 89 | |
| 90 | # Other Targets |
| 91 | clean: |
| 92 | -$(RM) $(OBJS) $(C_DEPS) $(CPP_DEPS) $(EXECUTABLES) receivedecompressandplay.o grabcompressandsend.o |
| 93 | -@echo ' ' |
| 94 | |
| 95 | |