makefile: support building example_bass

Add the juice needed to make example_bass buildable from the Makefile.

This should be compatible with MinGW and Linux.
This commit is contained in:
Erik Faye-Lund 2011-01-25 20:45:27 +01:00
parent 0b1ca80464
commit 0cf8728242

View File

@ -7,6 +7,18 @@ CFLAGS = -g -O2 -Wall
# user-defined config file (if available)
-include config.mak
ifdef COMSPEC
X = .exe
OPENGL_LIBS = -lopengl32 -lglu32
SDL_LIBS = -lSDL
LDLIBS += -lws2_32
else
OPENGL_LIBS = -lGL -lGLU
SDL_CFLAGS = $(shell sdl-config --cflags)
SDL_LIBS = $(shell sdl-config --libs)
LDLIBS += -lm
endif
SYNC_OBJS = \
sync/data.o \
sync/device.o \
@ -14,9 +26,18 @@ SYNC_OBJS = \
all: lib/librocket.a
bin/example_bass$X: CPPFLAGS += -Iexample_bass/include
bin/example_bass$X: CXXFLAGS += $(SDL_CFLAGS)
bin/example_bass$X: LDLIBS += -Lexample_bass/lib -lbass
bin/example_bass$X: LDLIBS += $(OPENGL_LIBS) $(SDL_LIBS)
clean:
$(RM) -rf $(SYNC_OBJS) lib
$(RM) -rf $(SYNC_OBJS) lib bin
lib/librocket.a: $(SYNC_OBJS)
@mkdir -p lib
$(AR) $(ARFLAGS) $@ $^
bin/example_bass$X: example_bass/example_bass.cpp lib/librocket.a
@mkdir -p bin
$(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@