Skip to content

Commit

Permalink
fix build with gmake and old win-builds
Browse files Browse the repository at this point in the history
  • Loading branch information
FunkyFr3sh committed Sep 13, 2024
1 parent 128a4b9 commit 01b1ff6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
21 changes: 14 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,28 @@

TARGET = ddraw.dll
LDFLAGS = -Wl,--enable-stdcall-fixup -s -static -shared
CFLAGS = -Iinc -O2 -march=i486 -Wall
CFLAGS = -Iinc -O2 -march=i486 -Wall -std=c99
LIBS = -lgdi32 -lwinmm -ldbghelp -lole32

COMMIT := $(shell git describe --match=NeVeRmAtCh --always --dirty || echo UNKNOWN)
BRANCH := $(shell git rev-parse --abbrev-ref HEAD || echo UNKNOWN)

CMDTEST := $(shell echo \"\")
ifeq ($(CMDTEST),\"\")
# Windows
ECOMMIT := $(shell echo #define GIT_COMMIT "$(COMMIT)" > inc/git.h)
EBRANCH := $(shell echo #define GIT_BRANCH "$(BRANCH)" >> inc/git.h)
# Windows
CMDTEST := $(shell echo "\#")
ifeq ($(CMDTEST),"\#")
# gmake
ECOMMIT := $(shell echo \#define GIT_COMMIT "$(COMMIT)" > inc/git.h)
EBRANCH := $(shell echo \#define GIT_BRANCH "$(BRANCH)" >> inc/git.h)
else
ECOMMIT := $(shell echo #define GIT_COMMIT "$(COMMIT)" > inc/git.h)
EBRANCH := $(shell echo #define GIT_BRANCH "$(BRANCH)" >> inc/git.h)
endif
else
# Either *nix or Windows with sh.exe (e.g. w64devkit)
ECOMMIT := $(shell echo \#define GIT_COMMIT \"$(COMMIT)\" > inc/git.h)
EBRANCH := $(shell echo \#define GIT_BRANCH \"$(BRANCH)\" >> inc/git.h)
# Either *nix or Windows with BusyBox (e.g. w64devkit)
ECOMMIT := $(shell echo \#define GIT_COMMIT \"$(COMMIT)\" > inc/git.h)
EBRANCH := $(shell echo \#define GIT_BRANCH \"$(BRANCH)\" >> inc/git.h)
endif

CC = i686-w64-mingw32-gcc
Expand Down
8 changes: 1 addition & 7 deletions inc/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ void dbg_dump_dds_blt_fast_flags(DWORD flags);
void dbg_dump_dds_lock_flags(DWORD flags);
char* dbg_d3d9_hr_to_str(HRESULT hr);
char* dbg_mes_to_str(int id);

void __cdecl dbg_invoke_watson(
_In_opt_z_ wchar_t const*,
_In_opt_z_ wchar_t const*,
_In_opt_z_ wchar_t const*,
_In_ unsigned int,
_In_ uintptr_t);
void __cdecl dbg_invoke_watson(wchar_t const*, wchar_t const*, wchar_t const*, unsigned int, uintptr_t);

extern double g_dbg_frame_time;
extern DWORD g_dbg_frame_count;
Expand Down

0 comments on commit 01b1ff6

Please sign in to comment.