Skip to content

Commit

Permalink
Windows build fixed, including icon resource compilation in Makefile.win
Browse files Browse the repository at this point in the history
  • Loading branch information
mborik committed May 5, 2018
1 parent 0a8ed6d commit b4bb8a6
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 51 deletions.
37 changes: 3 additions & 34 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,36 +1,5 @@
*.o
Makefile.in
aclocal.m4
autom4te.cache/
compile
config.guess
config.h
config.h.in
config.h.in~
config.log
config.status
config.sub
depcomp
install-sh
missing
sjasm/.deps/
sjasm/.dirstamp
stamp-h1
sjasm/devices.o
sjasm/directives.o
sjasm/io_snapshots.o
sjasm/io_tape.o
sjasm/io_trd.o
sjasm/parser.o
sjasm/reader.o
sjasm/sjasm.o
sjasm/sjio.o
sjasm/support.o
sjasm/tables.o
sjasm/z80.o
.deps
sjasmwin32/sjasmplus.res
sjasmplus
Makefile
configure
build/
.kdev4/
sjasmplus*
Makefile*
35 changes: 21 additions & 14 deletions Makefile.win
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Makefile for sjasmplus created by Tygrys' hands.
# install/uninstall features added, CFLAGS and LDFLAGS modification by z00m's hands. [05.05.2016]
# overall optimization and beautification by mborik's hands. [05.05.2016]
# MinGW adaptation and icon linking by z00m's hands. [21.10.2016, 08.09.2017]
# For build under MinGW delete linux Makefile, then rename Makefile.win to Makefile.
# MinGW adaptation and icon linking by z00m's hands. [21.10.2016, 08.09.2017]
# For build under MinGW run `make -f Makefile.win`.

GCC=gcc
GCC=gcc.exe
CC=$(GCC)
GPP=g++
GPP=g++.exe
C++=$(GPP)

PREFIX=c:\mingw\usr\local\bin
CREATEDIR=mkdir
INSTALL=copy
UNINSTALL=del
INSTALL=xcopy
UNINSTALL=rm -f
WINDRES=windres.exe --preprocessor "cpp.exe"

EXE=sjasmplus.exe
RES=sjasmwin32/sjasmplus.res

SUBDIR_BASE=sjasm
SUBDIR_LUA=lua5.1
Expand All @@ -42,7 +42,7 @@ OBJS=\
$(SUBDIR_BASE)/sjio.o \
$(SUBDIR_BASE)/support.o \
$(SUBDIR_BASE)/tables.o \
$(SUBDIR_BASE)/z80.o
$(SUBDIR_BASE)/z80.o

#liblua objects
LUAOBJS= \
Expand All @@ -65,8 +65,12 @@ TOLUAOBJS=\
$(SUBDIR_TOLUA)/tolua_push.o \
$(SUBDIR_TOLUA)/tolua_to.o

RES=sjasmwin32/sjasmplus.res


all: $(LUAOBJS) $(TOLUAOBJS) $(OBJS)
.PHONY: all clean

all: $(LUAOBJS) $(TOLUAOBJS) $(OBJS) $(RES)
$(GPP) -o $(EXE) $(CXXFLAGS) $(OBJS) $(LUAOBJS) $(TOLUAOBJS) $(LDFLAGS) $(RES)

install:
Expand All @@ -77,14 +81,17 @@ uninstall:
$(UNINSTALL) "$(PREFIX)\$(EXE)"

.c.o:
$(GCC) $(CFLAGS) -o $@ -c $<
$(GCC) $(CFLAGS) -o $@ -c $<

.cpp.o:
$(GPP) $(CFLAGS) -o $@ -c $<

$(RES): sjasmwin32/sjasmplus.mingw.rc
$(WINDRES) -i $< -O coff -o $@

clean:
$(UNINSTALL) \
$(SUBDIR_BASE)\*.o \
$(SUBDIR_LUA)\*.o \
$(SUBDIR_TOLUA)\*.o \
$(EXE) *~
$(SUBDIR_BASE)/*.o \
$(SUBDIR_LUA)/*.o \
$(SUBDIR_TOLUA)/*.o \
$(RES) $(EXE) *~
4 changes: 2 additions & 2 deletions sjasm/support.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ int SearchPath(char* oudzp, char* filename, char* whatever, int maxlen, char* ni
char* strset(char* str, char val) {
//non-aligned
char* pByte = str;
while (((unsigned long)pByte) & 3) {
while (((uintptr_t) pByte) & 3) {
if (*pByte) {
*pByte++ = val;
} else {
Expand Down Expand Up @@ -143,7 +143,7 @@ void LuaShellExec(char *command) {
#ifdef WIN32

WinExec(command, SW_SHOWNORMAL);
#else
#else
int ret = system(command);
if ( ret == -1 ) {
Error("[LUASHELEXEC] Unable to start child process for command", command, CATCHALL);
Expand Down
1 change: 0 additions & 1 deletion sjasmwin32/mingw.res.bat

This file was deleted.

Binary file removed sjasmwin32/sjasmplus.res
Binary file not shown.

0 comments on commit b4bb8a6

Please sign in to comment.