]>
Commit | Line | Data |
---|---|---|
8e877c19 RR |
1 | # Make environment for making samples on Unix |
2 | ||
3a922bb4 | 3 | # The binary program extension, if any, including dots (e.g. '.exe') |
80d895cd | 4 | PROGRAM_EXT = @PROGRAM_EXT@ |
3a922bb4 RL |
5 | BIN_PROGRAM = $(PROGRAM)$(PROGRAM_EXT) |
6 | RES_PROGRAM_OBJ = @RESPROGRAMOBJ@ | |
ef7f2189 | 7 | BUNDLE = $(BIN_PROGRAM).app/Contents |
3a922bb4 | 8 | |
f5be30b7 VZ |
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: | |
3a922bb4 | 13 | $(CC) -c $(CFLAGS) $(APPEXTRADEFS) -o $@ $< |
80d895cd | 14 | |
f5be30b7 | 15 | .cpp.o: |
3a922bb4 | 16 | $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $< |
2f51a9ec | 17 | |
f5be30b7 | 18 | .cxx.o: |
3a922bb4 | 19 | $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $< |
48b1d0ff | 20 | |
dd5cad7a | 21 | .rc_resources.o: |
3a922bb4 | 22 | $(RESCOMP) -i $< -o $@ $(RESFLAGS) |
48b1d0ff | 23 | |
48b1d0ff | 24 | |
4e9fd9e2 SN |
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 ':' | |
3a922bb4 | 28 | VPATH = @PATH_IFS@$(top_srcdir)/$(program_dir) # ':' for autoconf |
b1683d38 | 29 | |
549c6f67 | 30 | # Set defaults from configure |
3a922bb4 | 31 | include $(top_builddir)/src/make.env |
8e877c19 | 32 | |
ef7f2189 | 33 | all: $(BIN_PROGRAM) @MACOSX_BUNDLE@ install_dirs install_data |
8e877c19 | 34 | |
3a922bb4 | 35 | $(BIN_PROGRAM): $(OBJECTS) $(top_builddir)/lib/@WX_TARGET_LIBRARY@ $(RES_PROGRAM_OBJ) @LIBWXMACRES@ |
10cc14fa | 36 | $(CXX) $(LDFLAGS_EXE) -o $@ $(OBJECTS) $(LDLIBS) $(LIBRARIES) $(RES_PROGRAM_OBJ) |
2f51a9ec | 37 | @LIBWXMACRESCOMP@ |
32832908 | 38 | |
b1683d38 | 39 | install_dirs: |
3a922bb4 RL |
40 | @list='$(DATADIRS)'; for p in $$list; do \ |
41 | mkdir -p $(top_builddir)/$(program_dir)/$$p; \ | |
b1683d38 | 42 | done |
ef7f2189 | 43 | |
b1683d38 | 44 | install_data: |
3a922bb4 RL |
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; \ | |
b1683d38 RR |
48 | fi; \ |
49 | done | |
50 | ||
8e877c19 | 51 | clean: |
afb74fdd | 52 | rm -f $(OBJECTS) $(DEPFILES) $(BIN_PROGRAM) $(RES_PROGRAM_OBJ) core |
3a922bb4 | 53 | |
ef7f2189 GD |
54 | # |
55 | # Targets to build a Mac OS X application bundle | |
56 | # | |
10cc14fa | 57 | bundle: $(BUNDLE)/MacOS/$(PROGRAM) $(BUNDLE)/Info.plist $(BUNDLE)/PkgInfo $(BUNDLE)/Resources/$(PROGRAM).rsrc $(BUNDLE)/Resources/$(PROGRAM).icns |
ef7f2189 | 58 | |
c0187f69 | 59 | $(BUNDLE)/Info.plist: $(top_srcdir)/src/$(TOOLKITDIR)/Info.plist.in $(top_builddir)/lib/@WX_TARGET_LIBRARY@ |
ef7f2189 | 60 | @$(INSTALL) -d `dirname $@` |
6a1c4604 | 61 | sed -e "s/IDENTIFIER/`echo $(program_dir) | sed 's,/,.,g'`/" \ |
ef7f2189 GD |
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 | ||
10cc14fa | 69 | $(BUNDLE)/MacOS/$(PROGRAM): $(OBJECTS) $(top_builddir)/lib/@WX_TARGET_LIBRARY@ |
ef7f2189 | 70 | @$(INSTALL) -d `dirname $@` |
10cc14fa | 71 | $(CXX) $(LDFLAGS_EXE) -o $@ $(OBJECTS) $(LDLIBS) $(LIBRARIES) |
ef7f2189 | 72 | |
10cc14fa | 73 | $(BUNDLE)/Resources/$(PROGRAM).rsrc: $(top_builddir)/lib/@WX_RESOURCES_MACOSX_DATA@ |
c0187f69 GD |
74 | @$(INSTALL) -d `dirname $@` |
75 | cp $< $@ | |
ef7f2189 GD |
76 | |
77 | $(BUNDLE)/Resources/$(PROGRAM).icns: $(top_srcdir)/src/$(TOOLKITDIR)/wxmac.icns | |
78 | @$(INSTALL) -d `dirname $@` | |
79 | cp $< $@ |