Makefile 1006 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. PROG_SOURCE = yktrl.cpp
  2. SOURCE += commandParser.cpp
  3. SOURCE += ykushxs/ykushxs.cpp
  4. SOURCE += ykush/ykush.cpp
  5. SOURCE += ykush2/ykush2.cpp
  6. SOURCE += ykush3/ykush3.cpp
  7. SOURCE += yk_usb_device.cpp
  8. SOURCE += help/ykush_help.cpp
  9. SOURCE += utils/command_parser.cpp
  10. SOURCE += utils/string2val.cpp
  11. SOURCE += usbhid/usbhid.cpp
  12. SOURCE_FULL = $(addprefix src/, $(SOURCE))
  13. PROG_SOURCE_FULL = $(addprefix src/, $(PROG_SOURCE))
  14. OBJS = $(SOURCE_FULL:.cpp=.o)
  15. PROG_OBJ = $(PROG_SOURCE_FULL:.cpp=.o)
  16. DEFINES += _LINUX_
  17. DEFINES += _LIBUSB_
  18. COMPILE_FLAGS += $(addprefix -D, $(DEFINES))
  19. CUR_PATH = $(shell echo $(PWD))
  20. INCLUDEPATHS = $(addprefix -I$(CUR_PATH)/, $(dir $(SOURCE_FULL)) libusb )
  21. LOADPATHS =
  22. LIBS = -lusb-1.0
  23. CPP = g++
  24. ykushcmd : $(PROG_OBJ) $(OBJS)
  25. $(CPP) -o bin/$@ $(PROG_OBJ) $(OBJS) $(LIBS)
  26. $(PROG_OBJ) : %.o : %.cpp
  27. $(CPP) $(COMPILE_FLAGS) $(INCLUDEPATHS) -c $< -o $@
  28. $(OBJS) : %.o : %.cpp %.h
  29. $(CPP) $(COMPILE_FLAGS) $(INCLUDEPATHS) -c $< -o $@
  30. clean :
  31. rm -f bin/yktrl $(OBJS) $(PROG_OBJ)