You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

309 lines
5.6 KiB

  1. libs.dynamic
  2. CC = `wx-config --cc`
  3. # Note: at least on Debian using gcc gives a smaller binary than using:
  4. # `wx-config --ld`
  5. LD = gcc
  6. SRCSUFF = .cpp
  7. OBJSUFF = .o
  8. FINAL = 1
  9. WXPATH = `wx-config --prefix`/lib
  10. PREFIX_WX_LIBS = `wx-config --basename`
  11. SUFFIX_WX_LIBGL = _gl-$(LIBVERSION)
  12. LIBSTDC = -lstdc++
  13. LIBVERSION=`wx-config --release`
  14. WXSYSLIB= `wx-config --libs`
  15. # attention � l'ordre des libairies
  16. LIBS = -L/usr/local/lib -L/usr/X11R6/lib\
  17. $(EXTRALIBS) $(WXSYSLIB)\
  18. $(LIBSTDC)
  19. LIBS3D = -l$(PREFIX_WX_LIBS)$(SUFFIX_WX_LIBGL) -lGL -lGLU
  20. # Sub-projects
  21. KICAD_SUBDIRS = common 3d-viewer eeschema pcbnew cvpcb kicad gerbview wxhtml
  22. # How to invoke make
  23. MAKE := $(MAKE) -f makefile.gtk
  24. # File with the libraries definitions
  25. LIBSDEF = libs.dynamic
  26. # Prefix, can be from command line
  27. ifneq ($(strip $(prefix)),)
  28. IPREFIX=$(prefix)
  29. else
  30. IPREFIX=/usr/local/kicad/linux
  31. endif
  32. # Install tool, can be from command line
  33. ifeq ($(INSTALL),)
  34. INSTALL=install
  35. endif
  36. # C Flags, can be from command line
  37. ifeq ($(CFLAGS),)
  38. CFLAGS=-Wall -O2
  39. #CFLAGS=-Wall -Werror -g3
  40. endif
  41. CFLAGS:=$(CFLAGS) `wx-config --cxxflags`
  42. # Linker flags (strip)
  43. LDFLAGS = -s
  44. export
  45. .PHONY: $(KICAD_SUBDIRS)
  46. all: $(KICAD_SUBDIRS)
  47. common:
  48. cd $@ ; $(MAKE)
  49. 3d-viewer:
  50. cd $@ ; $(MAKE)
  51. eeschema:
  52. cd $@ ; $(MAKE)
  53. pcbnew:
  54. cd $@ ; $(MAKE)
  55. cvpcb:
  56. cd $@ ; $(MAKE)
  57. kicad:
  58. cd $@ ; $(MAKE)
  59. gerbview:
  60. cd $@ ; $(MAKE)
  61. wxhtml:
  62. cd $@ ; $(MAKE)
  63. install:
  64. @for d in $(KICAD_SUBDIRS); do (cd $$d && $(MAKE) install); done
  65. clean:
  66. @for d in $(KICAD_SUBDIRS); do (cd $$d && $(MAKE) clean); done
  67. 3d-viewer/makefile.gtk
  68. ## Makefile for 3d-viewer.a ( wxGTK - LINUX )
  69. # Compiler flags.
  70. CPPFLAGS = $(CFLAGS) -DPCBNEW -I../pcbnew -I ../include -I../common
  71. include ../$(LIBSDEF)
  72. TARGET = 3d-viewer
  73. all: $(TARGET).a
  74. include makefile.include
  75. $(TARGET).a: $(OBJECTS3D) makefile.gtk makefile.include
  76. rm -f $@
  77. ar -rv $@ $(OBJECTS3D)
  78. ranlib $@
  79. clean:
  80. -rm *.o *.a *~ .*~ core *.bak *.exe *.obj 2> /dev/null
  81. # No install target
  82. ## Makefile for common.a
  83. # Compiler flags.
  84. CPPFLAGS = $(CFLAGS) -I./ -I../include
  85. EDACPPFLAGS = $(CPPFLAGS)
  86. all: common.a
  87. include makefile.include
  88. CPPFLAGS += $(EXTRACPPFLAGS)
  89. EDACPPFLAGS = $(CPPFLAGS)
  90. common.a: $(OBJECTS) makefile.gtk makefile.include
  91. rm -f $@
  92. ar -rv $@ $(OBJECTS)
  93. ranlib $@
  94. clean:
  95. -rm *.o *.a *~ .*~ core *.bak *.exe *.obj 2> /dev/null
  96. # No install target
  97. # File: makefile
  98. # Compiler flags.
  99. CPPFLAGS = $(CFLAGS)
  100. EDACPPFLAGS = $(CPPFLAGS)
  101. include ../$(LIBSDEF)
  102. TARGET = cvpcb
  103. all: $(TARGET)
  104. include makefile.include
  105. CPPFLAGS += $(EXTRACPPFLAGS)
  106. EDACPPFLAGS = $(CPPFLAGS)
  107. $(TARGET): $(OBJECTS) makefile.gtk makefile.include $(EXTRALIBS) ../$(LIBSDEF) $(LIBVIEWER3D)
  108. $(LD) $(OBJECTS) $(LDFLAGS) $(LIBS) $(LIBVIEWER3D) $(LIBS3D) -o $(TARGET)
  109. install:
  110. $(INSTALL) -d -m 0755 $(IPREFIX)
  111. $(INSTALL) -m 0755 $(TARGET) $(IPREFIX)
  112. clean:
  113. -rm *.o *.a *~ .*~ core *.bak *.exe *.obj $(TARGET) 2> /dev/null
  114. ## Makefile for eeschema
  115. include ../$(LIBSDEF)
  116. TARGET = eeschema
  117. CPPFLAGS = $(CFLAGS)
  118. all: $(TARGET)
  119. include makefile.include
  120. CPPFLAGS += $(EXTRACPPFLAGS)
  121. EDACPPFLAGS = $(CPPFLAGS)
  122. $(TARGET): $(OBJECTS) makefile.gtk makefile.include $(EXTRALIBS) ../$(LIBSDEF)
  123. $(LD) $(OBJECTS) $(LDFLAGS) $(LIBS) -o $(TARGET)
  124. install:
  125. $(INSTALL) -d -m 0755 $(IPREFIX)
  126. $(INSTALL) -m 0755 $(TARGET) $(IPREFIX)
  127. clean:
  128. -rm *.o *.a *~ .*~ core *.bak *.exe *.obj $(TARGET) 2> /dev/null
  129. ## Makefile for GERBVIEW et wxGTK
  130. # Compiler flags.
  131. CPPFLAGS = $(CFLAGS)
  132. EXTRALIBS = ../common/common.a
  133. include ../$(LIBSDEF)
  134. TARGET = gerbview
  135. all: $(TARGET)
  136. include makefile.include
  137. CPPFLAGS += $(EXTRACPPFLAGS)
  138. EDACPPFLAGS = $(CPPFLAGS)
  139. $(TARGET): $(OBJECTS) makefile.gtk makefile.include $(EXTRALIBS) ../$(LIBSDEF)
  140. $(LD) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $(TARGET)
  141. install:
  142. $(INSTALL) -d -m 0755 $(IPREFIX)
  143. $(INSTALL) -m 0755 $(TARGET) $(IPREFIX)
  144. clean:
  145. -rm *.o *.a *~ .*~ core *.bak *.exe *.obj $(TARGET) 2> /dev/null
  146. # File: makefile for kicad, wxGTK
  147. # Compiler flags.
  148. CPPFLAGS = $(CFLAGS)
  149. include ../$(LIBSDEF)
  150. TARGET = kicad
  151. all: $(TARGET)
  152. include makefile.include
  153. CPPFLAGS += $(EXTRACPPFLAGS)
  154. EDACPPFLAGS = $(CPPFLAGS)
  155. $(TARGET): $(OBJECTS) makefile.gtk $(EXTRALIBS) ../$(LIBSDEF)
  156. $(LD) $(OBJECTS) $(LDFLAGS) $(LIBS) -o $(TARGET)
  157. install:
  158. $(INSTALL) -d -m 0755 $(IPREFIX)
  159. $(INSTALL) -m 0755 $(TARGET) $(IPREFIX)
  160. clean:
  161. -rm *.o *.a *~ .*~ core *.bak *.exe *.obj $(TARGET) 2> /dev/null
  162. ## Makefile for PCBNEW et wxGTK
  163. # Compiler flags.
  164. CPPFLAGS = $(CFLAGS)
  165. include ../$(LIBSDEF)
  166. TARGET = pcbnew
  167. all: $(TARGET)
  168. include makefile.include
  169. CPPFLAGS += $(EXTRACPPFLAGS)
  170. EDACPPFLAGS = $(CPPFLAGS)
  171. $(TARGET): $(OBJECTS) makefile.gtk makefile.include $(LIBVIEWER3D) $(EXTRALIBS) ../$(LIBSDEF)
  172. $(LD) $(LDFLAGS) $(OBJECTS) $(LIBS) $(LIBVIEWER3D) $(LIBS3D)\
  173. -o $(TARGET)
  174. install:
  175. $(INSTALL) -d -m 0755 $(IPREFIX)
  176. $(INSTALL) -m 0755 $(TARGET) $(IPREFIX)
  177. clean:
  178. -rm *.o *.a *~ .*~ core *.bak *.exe *.obj $(TARGET) 2> /dev/null
  179. ########################################################################
  180. ########################################################################
  181. # Compiler flags.
  182. CPPFLAGS = $(CFLAGS) -I./ -I../include -I../common
  183. EXTRALIBS =
  184. include ../$(LIBSDEF)
  185. TARGET = wxhtml
  186. OBJDIR =
  187. OBJSUFF = o
  188. .SUFFIXES: .cpp .h .o .cc
  189. .cpp.o :
  190. $(CC) -c $< -o $(<:.cpp=.o) $(CPPFLAGS)
  191. DEPEND =
  192. OBJECTS = $(TARGET).o helpfrm.o
  193. $(TARGET): $(OBJECTS) makefile.gtk ../common/common.a ../$(LIBSDEF)
  194. $(LD) $(OBJECTS) $(LDFLAGS) $(LIBS) -o $(TARGET)
  195. install:
  196. $(INSTALL) -d -m 0755 $(IPREFIX)
  197. $(INSTALL) -m 0755 $(TARGET) $(IPREFIX)
  198. clean:
  199. -rm *.o *.a *~ .*~ core *.bak *.exe *.obj $(TARGET) 2> /dev/null