forked from djdron/UnrealSpeccyP
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keeps original makefile to prepare a pull request
- Loading branch information
Showing
2 changed files
with
64 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
SRC_PATH = ../.. | ||
OBJ_BASE = Release | ||
|
||
PROJECT_NAME = unreal_speccy_portable | ||
SRCFOLDERS = . z80 tools tools/zlib tools/libpng tools/tinyxml snapshot ui platform platform/custom_ui platform/linux platform/sdl devices devices/fdd devices/input devices/sound | ||
CXXSRCS = $(foreach dir, $(SRCFOLDERS), $(wildcard $(SRC_PATH)/$(dir)/*.cpp)) | ||
CSRCS = $(foreach dir, $(SRCFOLDERS), $(wildcard $(SRC_PATH)/$(dir)/*.c)) | ||
|
||
CXX = /opt/gcw0-toolchain/usr/bin/mipsel-linux-g++ | ||
C = /opt/gcw0-toolchain/usr/bin/mipsel-linux-gcc | ||
|
||
SDLCONFIG = /opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/bin/sdl-config | ||
|
||
DIST_PATH = $(OBJ_BASE) | ||
OBJ_PATH = $(OBJ_BASE) | ||
CXX_OBJS = $(patsubst $(SRC_PATH)/%.cpp,$(OBJ_PATH)/%.o,$(CXXSRCS)) | ||
CXX_DEPS = $(patsubst $(SRC_PATH)/%.cpp,$(OBJ_PATH)/%.d,$(CXXSRCS)) | ||
C_OBJS = $(patsubst $(SRC_PATH)/%.c,$(OBJ_PATH)/%.o,$(CSRCS)) | ||
C_DEPS = $(patsubst $(SRC_PATH)/%.c,$(OBJ_PATH)/%.d,$(CSRCS)) | ||
BIN_TARGET = $(DIST_PATH)/$(PROJECT_NAME) | ||
OPK_TARGET = $(DIST_PATH)/$(PROJECT_NAME).opk | ||
|
||
DESKTOP_ENTRY = opk/default.gcw0.desktop | ||
ICON = opk/icon-32x32.png | ||
|
||
STD_OPTS = -G0 -O3 -Wall -c -fmessage-length=0 -finline-functions -fomit-frame-pointer -fno-builtin -fno-exceptions -fno-pic -DNDEBUG | ||
CXXFLAGS = $(STD_OPTS) -fno-rtti -fno-threadsafe-statics -D_POSIX -DUSE_SDL -DSDL_KEYS_DINGOO `$(SDLCONFIG) --cflags` | ||
CFLAGS = $(STD_OPTS) | ||
LFLAGS = -s `$(SDLCONFIG) --libs` | ||
|
||
all: build | ||
|
||
mkdirs: | ||
mkdir -p $(DIST_PATH) | ||
mkdir -p $(foreach dir, $(SRCFOLDERS), $(OBJ_PATH)/$(dir)) | ||
|
||
$(CXX_OBJS): $(OBJ_PATH)/%.o : $(SRC_PATH)/%.cpp | ||
$(CXX) $(CXXFLAGS) -o $@ $< | ||
|
||
$(C_OBJS): $(OBJ_PATH)/%.o : $(SRC_PATH)/%.c | ||
$(C) $(CFLAGS) -o $@ $< | ||
|
||
$(BIN_TARGET): $(CXX_OBJS) $(C_OBJS) | ||
$(CXX) $(LFLAGS) $^ -o$(BIN_TARGET) | ||
|
||
$(OPK_TARGET): $(BIN_TARGET) $(DESKTOP_ENTRY) $(ICON) | ||
mksquashfs $^ $@ -noappend -no-exports -no-xattrs -all-root | ||
|
||
build: $(OPK_TARGET) | ||
|
||
clean: | ||
rm -rf $(CXX_OBJS) | ||
rm -rf $(CXX_DEPS) | ||
rm -rf $(C_OBJS) | ||
rm -rf $(C_DEPS) | ||
rm -rf $(BIN_TARGET) | ||
|
||
.PHONY: mkdirs clean build all |