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-02-15 11:13:59 +01:00
|
|
|
CFLAGS ?=-ggdb -Wall `sdl-config --cflags` -ISrc -O2 -fno-exceptions
|
2010-01-22 07:28:46 +01:00
|
|
|
DEFINES =-DFRODO_SC -DHAVE_CONFIG_H -DDATADIR=\"$(datadir)/frodo/\" -DBINDIR=\"$(bindir)/\" -DHAVE_SDL
|
|
|
|
|
2010-05-08 09:52:04 +02:00
|
|
|
LDFLAGS ?= $(GCOV) `sdl-config --libs` -lSDL_ttf -lSDL_image -lpng
|
2010-01-22 07:28:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
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-02-08 19:24:00 +01:00
|
|
|
Src/1541job.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-02-09 12:33:30 +01:00
|
|
|
Src/gui/dialogue_box.cpp Src/gui/widget.cpp \
|
2010-01-25 14:01:22 +01:00
|
|
|
Src/gui/game_info.cpp Src/gui/status_bar.cpp Src/gui/gui.cpp Src/gui/listener.cpp \
|
2010-01-30 09:06:32 +01:00
|
|
|
Src/timer.cpp Src/utils.cpp Src/gui/virtual_keyboard.cpp Src/gui/menu.cpp \
|
2010-02-28 08:59:36 +01:00
|
|
|
Src/gui/file_browser.cpp Src/data_store.cpp Src/gui/network_server_messages.cpp
|
2010-01-25 14:01:22 +01:00
|
|
|
|
2010-02-09 12:33:30 +01:00
|
|
|
C_SRCS=Src/d64-read.c Src/gui/menu_messages.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-02-06 17:16:43 +01:00
|
|
|
all: deps $(TARGET)
|
2010-01-22 07:28:46 +01:00
|
|
|
deps: $(DEPS)
|
|
|
|
|
|
|
|
-include $(DEPS)
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
2010-03-01 12:40:01 +01:00
|
|
|
dist-host: $(TARGET)
|
2010-02-28 18:37:20 +01:00
|
|
|
rm -rf $@
|
2010-03-10 19:37:06 +01:00
|
|
|
install -d $@/c64-network.org
|
|
|
|
install -d $@/c64-network.org/images
|
|
|
|
install -d $@/c64-network.org/saves
|
|
|
|
install -d $@/c64-network.org/metadata
|
|
|
|
install -d $@/c64-network.org/tmp
|
|
|
|
cp $(TARGET) $@/c64-network.org/
|
|
|
|
cp -rap themes $@/c64-network.org/themes
|
|
|
|
cp icon.png $@/c64-network.org/
|
2010-02-28 18:37:20 +01:00
|
|
|
find $@ -name ".svn" | xargs rm -rf
|
2010-03-10 19:09:49 +01:00
|
|
|
cd $@ && tar -czf ../c64-network.org-host-bin.tar.gz *
|
2010-02-28 18:37:20 +01:00
|
|
|
|
|
|
|
dist: dist-host
|
|
|
|
|
2010-01-22 07:28:46 +01:00
|
|
|
$(TARGET): $(OBJS)
|
2010-01-25 10:59:26 +01:00
|
|
|
@echo LD $@
|
|
|
|
@$(LD) $(LDFLAGS) -o $@ $+
|