diff --git a/Makefile b/Makefile index 6f77421..2f3e1f5 100755 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ CFLAGS += -Werror -Wall -std=gnu11 -ICore -D_GNU_SOURCE -DVERSION="$(VERSION)" - SDL_LDFLAGS := -lSDL ifeq ($(PLATFORM),windows32) CFLAGS += -IWindows -LDFLAGS += -lmsvcrt -lSDLmain +LDFLAGS += -lmsvcrt -lSDLmain -Wl,/MANIFESTFILE:NUL else LDFLAGS += -lc -lm endif @@ -169,14 +169,21 @@ ifeq ($(CONF), release) endif # Windows version builds two, one with a conole and one without it -$(BIN)/sdl/sameboy.exe: $(CORE_OBJECTS) $(SDL_OBJECTS) +$(BIN)/sdl/sameboy.exe: $(CORE_OBJECTS) $(SDL_OBJECTS) $(OBJ)/Windows/resources.o -@$(MKDIR) -p $(dir $@) $(CC) $^ -o $@ $(LDFLAGS) $(SDL_LDFLAGS) -Wl,/subsystem:windows -$(BIN)/sdl/sameboy_debugger.exe: $(CORE_OBJECTS) $(SDL_OBJECTS) +$(BIN)/sdl/sameboy_debugger.exe: $(CORE_OBJECTS) $(SDL_OBJECTS) $(OBJ)/Windows/resources.o -@$(MKDIR) -p $(dir $@) $(CC) $^ -o $@ $(LDFLAGS) $(SDL_LDFLAGS) -Wl,/subsystem:console +$(OBJ)/%.res: %.rc + -@$(MKDIR) -p $(dir $@) + rc /fo $@ /dVERSION=\"$(VERSION)\" $^ + +%.o: %.res + cvtres /OUT:"$@" $^ + # We must provide SDL.dll with the Windows port. This is an AWFUL HACK to find it. SPACE := SPACE += diff --git a/Windows/resources.rc b/Windows/resources.rc new file mode 100644 index 0000000..74e3839 --- /dev/null +++ b/Windows/resources.rc @@ -0,0 +1,24 @@ +1 VERSIONINFO +FILEOS 0x4 +FILETYPE 0x1 +{ + BLOCK "StringFileInfo" + { + BLOCK "040904E4" + { + VALUE "CompanyName", "Lior Halphon" + VALUE "FileDescription", "SameBoy" + VALUE "FileVersion", VERSION + VALUE "LegalCopyright", "Copyright © 2015-2016 Lior Halphon" + VALUE "ProductName", "SameBoy" + VALUE "ProductVersion", VERSION + VALUE "WWW", "https://github.com/LIJI32/SameBoy" + } + } + BLOCK "VarFileInfo" + { + VALUE "Translation", 0x0409 0x04E4 + } +} + +IDI_ICON1 ICON DISCARDABLE "SameBoy.ico" \ No newline at end of file diff --git a/Windows/sameboy.ico b/Windows/sameboy.ico new file mode 100644 index 0000000..1d67769 Binary files /dev/null and b/Windows/sameboy.ico differ