]>
Commit | Line | Data |
---|---|---|
7f555861 JS |
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). | |
44c4a334 | 7 | # RCS-ID: $Id$ |
7f555861 | 8 | # |
7f555861 JS |
9 | ########################### Programs ################################# |
10 | ||
11 | # Replace this with your own path if necessary | |
5dcf05ae | 12 | WXDIR = $(WXWIN) |
7f555861 JS |
13 | |
14 | # C++ compiler | |
15 | CC = g++ | |
16 | ||
17 | # C compiler | |
18 | CCC = gcc | |
19 | ||
20 | # Compiler for lex/yacc .c programs | |
21 | CCLEX = $(CCC) | |
22 | ||
23 | LEX = lex | |
24 | YACC = yacc | |
777553d2 JS |
25 | # Note: if using bison, use -y option for yacc compatibility |
26 | # YACC = bison -y | |
7f555861 JS |
27 | MAKE = make |
28 | AROPTIONS = ruv | |
29 | RANLIB = ranlib | |
30 | ||
31 | ############################ Switches ################################# | |
32 | ||
33 | # Debug/trace mode. 1 or more for debugging. | |
b412f9be | 34 | DEBUG = 1 |
acbd13a3 | 35 | GUI = -D__WXSTUBS__ -D__UNIX__ |
7f555861 JS |
36 | GUISUFFIX = _stubs |
37 | ||
38 | ########################## Compiler flags ############################# | |
39 | ||
40 | # Misc options | |
acbd13a3 | 41 | OPTIONS = -D__LINUX__ -D__WXDEBUG__ |
7f555861 | 42 | COPTIONS = |
a533f5c1 | 43 | DEBUGFLAGS = # -ggdb |
7f555861 JS |
44 | INCLUDE = |
45 | WARN = -Wall -Wno-unused # -w | |
46 | CWARN = -Wall -Wno-unused # -w | |
a533f5c1 | 47 | OPT = -O2 |
7f555861 JS |
48 | |
49 | ############################ Includes ################################# | |
50 | ||
51 | # Compiler or system-specific include paths | |
52 | COMPPATHS = | |
53 | XINCLUDE = -I/usr/openwin/include -I/usr/include/X11 -I/usr/include/Xm \ | |
a533f5c1 RR |
54 | -I/usr/include/X11/Xm -I/usr/include -I/usr/local/include \ |
55 | -I/usr/lib/glib/include -I/usr/local/lib/glib/include | |
7f555861 JS |
56 | XLIB = -L/usr/local/X11/lib -L/usr/openwin/lib -L/usr/X11/lib -L/usr/X11R6/lib |
57 | ||
58 | ############################ Libraries ################################ | |
59 | ||
60 | COMPLIBS = -lstdc++ | |
a4294b78 | 61 | GUILDLIBS = -lwx_stubs $(COMPLIBS) -lXm -lXmu -lXt -lXpm -lX11 -lm |
7f555861 JS |
62 | |
63 | ############################# Suffixes ################################ | |
64 | ||
65 | # Change cpp to c if you want to use main.c instead of main.cpp. | |
66 | # Edit wx_setup.h accordingly (USE_C_MAIN=1) | |
67 | ||
68 | OBJSUFF =o | |
69 | SRCSUFF =cpp | |
70 | MAINSUFF =cpp | |
71 | ||
72 | ####################### No changes below this line #################### | |
73 | ||
74 | WXINC = $(WXDIR)/include | |
75 | WXLIB = $(WXDIR)/lib/libwx$(GUISUFFIX).a | |
a533f5c1 | 76 | INC = -I$(WXINC) -I$(WXDIR)/src/png -I$(WXDIR)/src/jpeg -I$(WXDIR)/src/zlib $(COMPPATHS) |
7f555861 JS |
77 | |
78 | # Directory for object files | |
79 | OBJDIR = objects$(GUISUFFIX) | |
80 | ||
75737d05 JS |
81 | CPPFLAGS = $(EXTRACPPFLAGS) $(INC) $(XINCLUDE) $(OPTIONS) $(GUI) $(DEBUGFLAGS) $(WARN) $(OPT) |
82 | CFLAGS = $(EXTRACFLAGS) $(INC) $(XINCLUDE) $(COPTIONS) $(GUI) $(DEBUGFLAGS) $(CWARN) $(OPT) | |
7f555861 JS |
83 | LDFLAGS = $(EXTRALDFLAGS) $(XLIB) -L$(WXDIR)/lib |
84 | LDLIBS = $(EXTRALDLIBS) $(GUILDLIBS) | |
85 | ||
86 | # Clears all default suffixes | |
87 | .SUFFIXES: .o .cpp .c | |
88 | ||
89 | .c.o : | |
3dd4e4e0 | 90 | $(CCC) -c $(CFLAGS) -o $@ $< |
7f555861 JS |
91 | |
92 | .cpp.o : | |
93 | $(CC) -c $(CPPFLAGS) -o $@ $< | |
94 | ||
8704bf74 JS |
95 | .C.o : |
96 | $(CC) -c $(CPPFLAGS) -o $@ $< | |
97 | ||
7f555861 JS |
98 | ####################### Targets to allow multiple GUIs #################### |
99 | ||
100 | dummy: | |
101 | echo Use a target: one of motif, stubs | |
102 | ||
103 | stubs: | |
acbd13a3 | 104 | make -f makefile.unx all GUI='-D__WXSTUBS__ -D__UNIX__' GUISUFFIX='_stubs' GUILDLIBS='-lwx_stubs $(COMPLIBS) -lXm -lXmu -lXt -lX11 -lm' |
7f555861 JS |
105 | |
106 | motif: | |
acbd13a3 | 107 | make -f makefile.unx all GUI='-D__WXMOTIF__ -D__UNIX__' GUISUFFIX='_motif' GUILDLIBS='-lwx_motif $(COMPLIBS) -lpng -lzlib -lXm -lXmu -lXt -lXpm -lX11 -lm' |
7f555861 | 108 | |
f97c9854 | 109 | gtk: |
a533f5c1 | 110 | make -f makefile.unx all GUI='-D__WXGTK__ -D__UNIX__' GUISUFFIX='_gtk' GUILDLIBS='-lwx_gtk $(COMPLIBS) -ldl `gtk-config --libs` -lX11 -lm -pthread' |
f97c9854 | 111 | |
7f555861 | 112 | cleanstubs: |
acbd13a3 | 113 | make -f makefile.unx clean GUI='-D__WXSTUBS__ -D__UNIX__' GUISUFFIX='_stubs' GUILDLIBS='-lwx_stubs $(COMPLIBS) -lXm -lXmu -lXt -lX11 -lm' |
7f555861 JS |
114 | |
115 | cleanmotif: | |
acbd13a3 JS |
116 | make -f makefile.unx clean GUI='-D__WXMOTIF__ -D__UNIX__' GUISUFFIX='_motif' GUILDLIBS='-lwx_motif $(COMPLIBS) -lXm -lXmu -lXt -lX11 -lm' |
117 | ||
118 | cleangtk: | |
119 | make -f makefile.unx clean GUI='-D__WXGTK__ -D__UNIX__' GUISUFFIX='_gtk' | |
7f555861 JS |
120 | |
121 | $(OBJDIR): | |
122 | mkdir $(OBJDIR) | |
123 |