]>
Commit | Line | Data |
---|---|---|
1 | # generic.env | |
2 | # Linux/generic | |
3 | # | |
4 | # Common makefile settings for wxWindows programs | |
5 | # This file is included by all the other makefiles, thus changes | |
6 | # made here take effect everywhere (except where overriden). | |
7 | # | |
8 | ########################### Programs ################################# | |
9 | ||
10 | # Replace this with your own path if necessary | |
11 | WXDIR = /home/jacs/wx2 | |
12 | ||
13 | # C++ compiler | |
14 | CC = g++ | |
15 | ||
16 | # C compiler | |
17 | CCC = gcc | |
18 | ||
19 | # Compiler for lex/yacc .c programs | |
20 | CCLEX = $(CCC) | |
21 | ||
22 | LEX = lex | |
23 | YACC = yacc | |
24 | MAKE = make | |
25 | AROPTIONS = ruv | |
26 | RANLIB = ranlib | |
27 | ||
28 | ############################ Switches ################################# | |
29 | ||
30 | # Debug/trace mode. 1 or more for debugging. | |
31 | DEBUG = 0 | |
32 | GUI = -D__WXSTUBS__ -D__LINUX__ -D__UNIX__ | |
33 | GUISUFFIX = _stubs | |
34 | ||
35 | ########################## Compiler flags ############################# | |
36 | ||
37 | # Misc options | |
38 | OPTIONS = -D__WXDEBUG__ -DWXDEBUG | |
39 | COPTIONS = | |
40 | DEBUGFLAGS = -ggdb | |
41 | INCLUDE = | |
42 | WARN = -Wall -Wno-unused # -w | |
43 | CWARN = -Wall -Wno-unused # -w | |
44 | OPT = # -O2 | |
45 | ||
46 | ############################ Includes ################################# | |
47 | ||
48 | # Compiler or system-specific include paths | |
49 | COMPPATHS = | |
50 | XINCLUDE = -I/usr/openwin/include -I/usr/include/X11 -I/usr/include/Xm \ | |
51 | -I/usr/include/X11/Xm -I/usr/include | |
52 | XLIB = -L/usr/local/X11/lib -L/usr/openwin/lib -L/usr/X11/lib -L/usr/X11R6/lib | |
53 | ||
54 | ############################ Libraries ################################ | |
55 | ||
56 | COMPLIBS = -lstdc++ | |
57 | GUILDLIBS = -lwx_stubs $(COMPLIBS) -lXm -lXmu -lXt -lXpm -lX11 -lm | |
58 | ||
59 | ############################# Suffixes ################################ | |
60 | ||
61 | # Change cpp to c if you want to use main.c instead of main.cpp. | |
62 | # Edit wx_setup.h accordingly (USE_C_MAIN=1) | |
63 | ||
64 | OBJSUFF =o | |
65 | SRCSUFF =cpp | |
66 | MAINSUFF =cpp | |
67 | ||
68 | ####################### No changes below this line #################### | |
69 | ||
70 | WXINC = $(WXDIR)/include | |
71 | WXLIB = $(WXDIR)/lib/libwx$(GUISUFFIX).a | |
72 | INC = -I$(WXINC) -I$(WXDIR)/src/png -I$(WXDIR)/src/zlib $(COMPPATHS) | |
73 | ||
74 | # Directory for object files | |
75 | OBJDIR = objects$(GUISUFFIX) | |
76 | ||
77 | CPPFLAGS = $(EXTRACPPFLAGS) $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) -DDEBUG='$(DEBUG)' $(WARN) $(OPT) | |
78 | CFLAGS = $(EXTRACFLAGS) $(XINCLUDE) $(INC) $(COPTIONS) $(GUI) $(DEBUGFLAGS) -DDEBUG='$(DEBUG)' $(CWARN) $(OPT) | |
79 | LDFLAGS = $(EXTRALDFLAGS) $(XLIB) -L$(WXDIR)/lib | |
80 | LDLIBS = $(EXTRALDLIBS) $(GUILDLIBS) | |
81 | ||
82 | # Clears all default suffixes | |
83 | .SUFFIXES: .o .cpp .c | |
84 | ||
85 | .c.o : | |
86 | $(CC) -c $(CFLAGS) -o $@ $< | |
87 | ||
88 | .cpp.o : | |
89 | $(CC) -c $(CPPFLAGS) -o $@ $< | |
90 | ||
91 | .C.o : | |
92 | $(CC) -c $(CPPFLAGS) -o $@ $< | |
93 | ||
94 | ####################### Targets to allow multiple GUIs #################### | |
95 | ||
96 | dummy: | |
97 | echo Use a target: one of motif, stubs | |
98 | ||
99 | stubs: | |
100 | make -f makefile.unx all GUI='-D__WXSTUBS__ -D__LINUX__ -D__UNIX__' GUISUFFIX='_stubs' GUILDLIBS='-lwx_stubs $(COMPLIBS) -lXm -lXmu -lXt -lX11 -lm' | |
101 | ||
102 | motif: | |
103 | make -f makefile.unx all GUI='-D__WXMOTIF__ -D__LINUX__ -D__UNIX__' GUISUFFIX='_motif' GUILDLIBS='-lwx_motif $(COMPLIBS) -lXm -lXmu -lXt -lXpm -lX11 -lm' | |
104 | ||
105 | gtk: | |
106 | make -f makefile.unx all GUI='-D__WXGTK__ -D__LINUX__ -D__UNIX__' GUISUFFIX='_gtk' GUILDLIBS='-lwx_gtk $(COMPLIBS) -lXm -lXmu -lXpm -lX11 -lm' | |
107 | ||
108 | cleanstubs: | |
109 | make -f makefile.unx clean GUI='-D__WXSTUBS__ -D__LINUX__ -D__UNIX__' GUISUFFIX='_stubs' GUILDLIBS='-lwx_stubs $(COMPLIBS) -lXm -lXmu -lXt -lX11 -lm' | |
110 | ||
111 | cleanmotif: | |
112 | make -f makefile.unx clean GUI='-D__WXMOTIF__ -D__LINUX__ -D__UNIX__' GUISUFFIX='_motif' GUILDLIBS='-lwx_motif $(COMPLIBS) -lXm -lXmu -lXt -lX11 -lm' | |
113 | ||
114 | $(OBJDIR): | |
115 | mkdir $(OBJDIR) | |
116 |