]> git.saurik.com Git - wxWidgets.git/blob - src/makeprog.env.in
UsePrimarySelection
[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 @LIBWXMACRESCOMP@
38
39 install_dirs:
40 @list='$(DATADIRS)'; for p in $$list; do \
41 mkdir -p $(top_builddir)/$(program_dir)/$$p; \
42 done
43
44 install_data:
45 @list='$(DATAFILES)'; for p in $$list; do \
46 if test ! -s $(top_builddir)/$(program_dir)/$$p; then \
47 cp -pRf $(top_srcdir)/$(program_dir)/$$p $(top_builddir)/$(program_dir)/$$p; \
48 fi; \
49 done
50
51 clean:
52 rm -f $(OBJECTS) $(DEPFILES) $(BIN_PROGRAM) $(RES_PROGRAM_OBJ) core
53
54 #
55 # Targets to build a Mac OS X application bundle
56 #
57 bundle: $(BUNDLE)/MacOS/$(PROGRAM) $(BUNDLE)/Info.plist $(BUNDLE)/PkgInfo $(BUNDLE)/Resources/$(PROGRAM).rsrc $(BUNDLE)/Resources/$(PROGRAM).icns
58
59 $(BUNDLE)/Info.plist: $(top_srcdir)/src/$(TOOLKITDIR)/Info.plist.in $(top_builddir)/lib/@WX_TARGET_LIBRARY@
60 @$(INSTALL) -d `dirname $@`
61 sed -e "s/IDENTIFIER/`echo $(program_dir) | sed 's,/,.,g'`/" \
62 -e "s/EXECUTABLE/$(PROGRAM)/" \
63 -e "s/VERSION/$(WX_MAJOR_VERSION_NUMBER).$(WX_MINOR_VERSION_NUMBER).$(WX_RELEASE_NUMBER)/" $< > $@
64
65 $(BUNDLE)/PkgInfo:
66 @$(INSTALL) -d `dirname $@`
67 echo -n "APPL????" > $@
68
69 $(BUNDLE)/MacOS/$(PROGRAM): $(OBJECTS) $(top_builddir)/lib/@WX_TARGET_LIBRARY@
70 @$(INSTALL) -d `dirname $@`
71 $(CXX) $(LDFLAGS_EXE) -o $@ $(OBJECTS) $(LDLIBS) $(LIBRARIES)
72
73 $(BUNDLE)/Resources/$(PROGRAM).rsrc: $(top_builddir)/lib/@WX_RESOURCES_MACOSX_DATA@
74 @$(INSTALL) -d `dirname $@`
75 cp $< $@
76
77 $(BUNDLE)/Resources/$(PROGRAM).icns: $(top_srcdir)/src/$(TOOLKITDIR)/wxmac.icns
78 @$(INSTALL) -d `dirname $@`
79 cp $< $@