From The Compiler, 5 Years ago, written in Make.
Embed
  1. all: XPlaneTCPConnector
  2.  
  3. clean: clean_XPlaneTCPConnector
  4.  
  5. #--------------------------
  6. # TARGET: XPlaneTCPConnector
  7. #--------------------------
  8. TOP_XPlaneTCPConnector=./
  9. WD_XPlaneTCPConnector=$(shell cd ${TOP_XPlaneTCPConnector};echo `pwd`)
  10. cpp_SRC_XPlaneTCPConnector+=${WD_XPlaneTCPConnector}/XPlaneTCPConnector.cpp
  11.  
  12. OBJS_XPlaneTCPConnector+=$(cpp_SRC_XPlaneTCPConnector:.cpp=.cpp.o)
  13.  
  14. CFLAGS_XPlaneTCPConnector+= -iquote./\
  15.  -iquote- -iquote/usr/include/xplane_sdk/XPLM\
  16.  -iquote- -iquote/usr/include/xplane_sdk/Widgets\
  17.  -iquote- -iquote/usr/include/xplane_sdk/Wrappers\
  18.   -DIBM=0 -DAPL=0 -DLIN=1 -DXPLM200=1
  19.  
  20. DBG=-g
  21.  
  22. CFLAGS_XPlaneTCPConnector+=-O0 -x c++ -ansi -m32 -Wall
  23.  
  24. clean_XPlaneTCPConnector:
  25.         rm -f ${OBJS_XPlaneTCPConnector}
  26.         rm -f XPlaneTCPConnector.cpp.d
  27.         rm -f XPlaneTCPConnector.d
  28.         rm -f *.xpl
  29.  
  30. XPlaneTCPConnector:
  31.         $(MAKE) XPlaneTCPConnector.xpl TARGET=XPlaneTCPConnector.xpl\
  32.  CC="g++"  LD="g++"  AR="ar -crs"  SIZE="size" LIBS+="-lGL -lGLU"
  33.  
  34. XPlaneTCPConnector.xpl: ${OBJS_XPlaneTCPConnector}
  35.         ${CC} -m32 -shared ${LDFLAGS} -o XPlaneTCPConnector.xpl ${OBJS_XPlaneTCPConnector} ${LIBS}
  36.  
  37.  
  38. ifeq (${TARGET}, XPlaneTCPConnector.xpl)
  39.  
  40. %.cpp.o: %.cpp
  41.         gcc -c -fPIC ${CFLAGS_XPlaneTCPConnector} $< -o $@ -MMD
  42. include $(cpp_SRC_XPlaneTCPConnector:.cpp=.d)
  43.  
  44. %.d: %.cpp
  45.         set -e; $(CC) -M $(CFLAGS_XPlaneTCPConnector) $< \
  46.  | sed 's!\($(*F)\)\.o[ :]*!$(*D)/\1.o $@ : !g' > $@; \
  47.  [ -s $@ ] || rm -f $@
  48.  
  49. endif
  50. # end Makefile
  51.