]> git.saurik.com Git - wxWidgets.git/blob - src/makeprog.env.in
added line selection
[wxWidgets.git] / src / makeprog.env.in
1 # Make environment for making samples on Unix
2
3 # The binary program extension, if any, including dots (e.g. '.exe')
4 PROGRAM_EXT = @PROGRAM_EXT@
5 BIN_PROGRAM = $(PROGRAM)$(PROGRAM_EXT)
6 RES_PROGRAM_OBJ = @RESPROGRAMOBJ@
7 BUNDLE = $(BIN_PROGRAM).app/Contents
8
9 # NB: see remark in Makefile.in as to why we don't use %.foo: %.bar rules
10 .SUFFIXES: .o .c .cpp .cxx .rc _resources.o
11
12 .c.o:
13 $(CC) -c $(CFLAGS) $(APPEXTRADEFS) -o $@ $<
14
15 .cpp.o:
16 $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $<
17
18 .cxx.o:
19 $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $<
20
21 .rc_resources.o:
22 $(RESCOMP) -i $< -o $@ $(RESFLAGS)
23
24
25 # the comment at the end of the next line is needed because otherwise autoconf
26 # would remove this line completely - it contains a built-in hack to remove
27 # any VPATH assignment not containing ':'
28 VPATH = @PATH_IFS@$(top_srcdir)/$(program_dir) # ':' for autoconf
29
30 # Set defaults from configure
31 include $(top_builddir)/src/make.env
32
33 all: $(BIN_PROGRAM) @MACOSX_BUNDLE@ install_dirs install_data
34
35 $(BIN_PROGRAM): $(OBJECTS) $(top_builddir)/lib/@WX_TARGET_LIBRARY@ $(RES_PROGRAM_OBJ) @LIBWXMACRES@
36 $(CXX) $(LDFLAGS_EXE) -o $@ $(OBJECTS) $(LDLIBS) $(LIBRARIES) $(RES_PROGRAM_OBJ)
37 @MACRESCOMP@ $(BIN_PROGRAM) $(RESOPTIONS)
38 @MACSETFILE@ $(SETOPTIONS) $(BIN_PROGRAM)
39
40 install_dirs:
41 @list='$(DATADIRS)'; for p in $$list; do \
42 mkdir -p $(top_builddir)/$(program_dir)/$$p; \
43 done
44
45 install_data:
46 @list='$(DATAFILES)'; for p in $$list; do \
47 if test ! -s $(top_builddir)/$(program_dir)/$$p; then \
48 cp -pRf $(top_srcdir)/$(program_dir)/$$p $(top_builddir)/$(program_dir)/$$p; \
49 fi; \
50 done
51
52 clean:
53 rm -f $(OBJECTS) $(DEPFILES) $(BIN_PROGRAM) $(RES_PROGRAM_OBJ) core
54
55 #
56 # Targets to build a Mac OS X application bundle
57 #
58 bundle: $(BUNDLE)/MacOS/$(PROGRAM) $(BUNDLE)/Info.plist $(BUNDLE)/PkgInfo $(BUNDLE)/Resources/$(PROGRAM).rsrc $(BUNDLE)/Resources/wxmac.icns
59
60 $(BUNDLE)/Info.plist: $(top_srcdir)/src/$(TOOLKITDIR)/Info.plist.in $(top_builddir)/lib/@WX_TARGET_LIBRARY@
61 @$(INSTALL) -d `dirname $@`
62 sed -e "s/IDENTIFIER/`echo $(program_dir) | sed 's,/,.,g'`/" \
63 -e "s/EXECUTABLE/$(PROGRAM)/" \
64 -e "s/VERSION/$(WX_MAJOR_VERSION_NUMBER).$(WX_MINOR_VERSION_NUMBER).$(WX_RELEASE_NUMBER)/" $< > $@
65
66 $(BUNDLE)/PkgInfo:
67 @$(INSTALL) -d `dirname $@`
68 echo -n "APPL????" > $@
69
70 $(BUNDLE)/MacOS/$(PROGRAM): $(OBJECTS) $(top_builddir)/lib/@WX_TARGET_LIBRARY@
71 @$(INSTALL) -d `dirname $@`
72 $(CXX) $(LDFLAGS_EXE) -o $@ $(OBJECTS) $(LDLIBS) $(LIBRARIES)
73
74 $(BUNDLE)/Resources/$(PROGRAM).rsrc: $(top_builddir)/lib/@WX_RESOURCES_MACOSX_DATA@
75 @$(INSTALL) -d `dirname $@`
76 cp $< $@
77
78 $(BUNDLE)/Resources/wxmac.icns: $(top_srcdir)/src/$(TOOLKITDIR)/wxmac.icns
79 @$(INSTALL) -d `dirname $@`
80 cp $< $@