2010-01-22 07:28:46 +01:00
|
|
|
######################################################################
|
|
|
|
##
|
|
|
|
## Copyright (C) 2008-2010, Simon Kagstrom
|
|
|
|
##
|
|
|
|
## Filename: Makefile
|
|
|
|
## Author: Simon Kagstrom <simon.kagstrom@gmail.com>
|
|
|
|
## Description: Makefile for host builds (from Cibyl)
|
|
|
|
##
|
|
|
|
## $Id:$
|
|
|
|
##
|
|
|
|
######################################################################
|
|
|
|
CXX = g++
|
|
|
|
CC = gcc
|
|
|
|
LD = g++
|
|
|
|
CPP = cpp
|
|
|
|
|
|
|
|
ERROR_FILTER := 2>&1 | sed -e 's/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/g'
|
|
|
|
|
|
|
|
|
|
|
|
PREFIX ?= /usr/local
|
|
|
|
exec_prefix = ${PREFIX}
|
|
|
|
bindir = ${exec_prefix}/bin
|
|
|
|
datadir = ${PREFIX}/share
|
|
|
|
#GCOV=-fprofile-arcs -ftest-coverage
|
|
|
|
|
|
|
|
|
2010-01-25 16:22:45 +01:00
|
|
|
CFLAGS ?=-ggdb -Wall `sdl-config --cflags` -ISrc -O2
|
2010-01-22 07:28:46 +01:00
|
|
|
DEFINES =-DFRODO_SC -DHAVE_CONFIG_H -DDATADIR=\"$(datadir)/frodo/\" -DBINDIR=\"$(bindir)/\" -DHAVE_SDL
|
|
|
|
|
|
|
|
LDFLAGS ?= $(GCOV) `sdl-config --libs` -lSDL_ttf -lSDL_image
|
|
|
|
|
|
|
|
|
|
|
|
CPP_SRCS=Src/C64_SC.cpp Src/main.cpp Src/Display.cpp Src/Prefs.cpp Src/SID.cpp \
|
|
|
|
Src/REU.cpp Src/IEC.cpp Src/1541fs.cpp Src/1541d64.cpp Src/1541t64.cpp \
|
2010-01-25 14:01:22 +01:00
|
|
|
Src/1541job.cpp Src/SAM.cpp Src/CPUC64_SC.cpp Src/VIC_SC.cpp \
|
2010-01-22 07:28:46 +01:00
|
|
|
Src/CIA_SC.cpp Src/CPU1541_SC.cpp Src/CPU_common.cpp Src/Network.cpp \
|
2010-01-25 14:01:22 +01:00
|
|
|
Src/gui/menu_messages.cpp Src/gui/dialogue_box.cpp Src/gui/widget.cpp \
|
|
|
|
Src/gui/game_info.cpp Src/gui/status_bar.cpp Src/gui/gui.cpp Src/gui/listener.cpp \
|
|
|
|
Src/gui/timer.cpp Src/gui/utils.cpp Src/gui/virtual_keyboard.cpp Src/gui/menu.cpp
|
|
|
|
|
|
|
|
C_SRCS=Src/d64-read.c
|
2010-01-22 07:28:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
OBJS=$(patsubst %.cpp,objs-host/%.o,$(CPP_SRCS)) $(patsubst %.c,objs-host/%.o,$(C_SRCS))
|
|
|
|
DEPS=$(patsubst %.cpp,deps/%.d,$(CPP_SRCS)) $(patsubst %.c,deps/%.d,$(C_SRCS))
|
|
|
|
|
|
|
|
|
|
|
|
TARGET=frodo
|
|
|
|
|
2010-01-25 16:06:58 +01:00
|
|
|
all: Src/sysconfig.h deps $(TARGET)
|
2010-01-22 07:28:46 +01:00
|
|
|
deps: $(DEPS)
|
|
|
|
|
|
|
|
-include $(DEPS)
|
|
|
|
|
2010-01-25 16:06:58 +01:00
|
|
|
Src/sysconfig.h: Src/sysconfig.h.Host-SDL
|
|
|
|
cp $< $@
|
|
|
|
|
2010-01-22 07:28:46 +01:00
|
|
|
clean:
|
|
|
|
rm -rf objs-host/* deps/* *.gcda *.gcno *~ $(TARGET) $(TARGET)-gcov
|
|
|
|
|
|
|
|
deps/%.d: %.cpp
|
|
|
|
@echo makedep $(notdir $<)
|
|
|
|
@install -d deps/$(dir $<)
|
2010-01-25 10:59:26 +01:00
|
|
|
@$(CPP) -M -MT objs-host/$(patsubst %.cpp,%.o,$<) $(DEFINES) $(CFLAGS) -o $@ $<
|
2010-01-22 07:28:46 +01:00
|
|
|
|
|
|
|
deps/%.d: %.c
|
|
|
|
@echo makedep $(notdir $<)
|
|
|
|
@install -d deps/$(dir $<)
|
2010-01-25 10:59:26 +01:00
|
|
|
@$(CPP) -M -MT objs-host/$(patsubst %.c,%.o,$<) $(DEFINES) $(CFLAGS) -o $@ $<
|
2010-01-22 07:28:46 +01:00
|
|
|
|
|
|
|
objs-host/%.o: %.cpp
|
2010-01-25 10:59:26 +01:00
|
|
|
@echo CXX $(notdir $<)
|
2010-01-22 07:28:46 +01:00
|
|
|
@install -d objs-host/$(dir $<)
|
|
|
|
@$(CXX) $(CFLAGS) $(DEFINES) -c -o $@ $< $(ERROR_FILTER)
|
|
|
|
|
|
|
|
objs-host/%.o: %.c
|
2010-01-25 10:59:26 +01:00
|
|
|
@echo CC $(notdir $<)
|
2010-01-22 07:28:46 +01:00
|
|
|
@install -d objs-host/$(dir $<)
|
|
|
|
@$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< $(ERROR_FILTER)
|
|
|
|
|
|
|
|
$(TARGET): $(OBJS)
|
2010-01-25 10:59:26 +01:00
|
|
|
@echo LD $@
|
|
|
|
@$(LD) $(LDFLAGS) -o $@ $+
|