-Penguin: penguin.o trackball.o lw.o
- $(CPP) -o Penguin \
- penguin.o trackball.o lw.o \
- `wx-config --libs` -lwx_gtk_gl $(OPENGL_LIBS)
+# C++ compiler
+CXX = `$(WX_CONFIG) --cxx`
+
+# Standard flags for CC
+CFLAGS ?=
+
+# Standard flags for C++
+CXXFLAGS ?=
+
+# Standard preprocessor flags (common for CC and CXX)
+CPPFLAGS ?=
+
+# Standard linker flags
+LDFLAGS ?=
+
+# Location and arguments of wx-config script
+WX_CONFIG ?= wx-config
+
+# Port of the wx library to build against [gtk1,gtk2,msw,x11,motif,mgl,osx_cocoa,osx_carbon,dfb]
+WX_PORT ?= $(shell $(WX_CONFIG) --query-toolkit)
+
+# Use DLL build of wx library to use? [0,1]
+WX_SHARED ?= $(shell if test -z `$(WX_CONFIG) --query-linkage`; then echo 1; else echo 0; fi)
+
+# Compile Unicode build of wxWidgets? [0,1]
+WX_UNICODE ?= $(shell $(WX_CONFIG) --query-chartype | sed 's/unicode/1/;s/ansi/0/')
+
+# Version of the wx library to build against.
+WX_VERSION ?= $(shell $(WX_CONFIG) --query-version | sed -e 's/\([0-9]*\)\.\([0-9]*\)/\1\2/')
+
+