Skip to content

Commit

Permalink
Merge branch 'dkfans:master' into Fixes4AK
Browse files Browse the repository at this point in the history
  • Loading branch information
walt253 authored Oct 28, 2024
2 parents b200b5a + 3ec8792 commit 70ee04e
Show file tree
Hide file tree
Showing 22 changed files with 77 additions and 19,839 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ docs/latex
*.Tpo
res/keeperfx_icon.ico
.header_checksum
/deps/enet
/deps/zlib
/deps/spng
/deps/astronomy
/deps/centijson
/deps/*.tar.gz
13 changes: 0 additions & 13 deletions .gitmodules

This file was deleted.

131 changes: 60 additions & 71 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,9 @@ HVLOGBIN = bin/keeperfx_hvlog$(EXEEXT)
# Names of intermediate build products
GENSRC = obj/ver_defs.h
RES = obj/keeperfx_stdres.res
LIBS = obj/enet.a

DEPS = \
obj/spng.o \
obj/json/json.o \
obj/json/value.o \
obj/json/json-dom.o \
obj/centitoml/toml_api.o \
obj/astronomy.o \
obj/unzip.o \
obj/ioapi.o
obj/centitoml/toml_api.o

# functional test debugging flags/objs
FTEST_DEBUG ?= 0
Expand Down Expand Up @@ -352,10 +344,23 @@ CU_OBJS = \
obj/cu/Util.o

# include and library directories
LINKLIB = -L"sdl/lib" -mwindows obj/enet.a \
-lwinmm -lmingw32 -limagehlp -lSDL2main -lSDL2 -lSDL2_mixer -lSDL2_net -lSDL2_image \
-L"deps/zlib" -lz -lws2_32 -ldbghelp
INCS = -I"sdl/include" -I"sdl/include/SDL2" -I"deps/enet/include" -I"deps/centijson/src" -I"deps/centitoml" -I"deps/astronomy"
LINKLIB = -mwindows \
-L"sdl/lib" -lSDL2 -lSDL2_mixer -lSDL2_net -lSDL2_image \
-L"deps/astronomy" -lastronomy \
-L"deps/enet" -lenet \
-L"deps/spng" -lspng \
-L"deps/centijson" -ljson \
-L"deps/zlib" -lminizip -lz \
-lwinmm -lmingw32 -limagehlp -lws2_32 -ldbghelp
INCS = \
-I"deps/zlib/include" \
-I"deps/spng/include" \
-I"sdl/include" \
-I"sdl/include/SDL2" \
-I"deps/enet/include" \
-I"deps/centijson/include" \
-I"deps/centitoml" \
-I"deps/astronomy/include"
CXXINCS = $(INCS)

STDOBJS = $(subst obj/,obj/std/,$(OBJS))
Expand Down Expand Up @@ -458,15 +463,12 @@ FOLDERS = bin obj/std obj/hvlog \
obj/std/ftests \
obj/std/ftests/tests \
obj/tests obj/cu \
obj/std/json obj/hvlog/json \
obj/std/centitoml obj/hvlog/centitoml \
obj/enet \
sdl/for_final_package

$(shell $(MKDIR) $(FOLDERS))

# We need this file because we need git update
build-before: libexterns deps/zlib/configure.log
build-before: libexterns

std-before: build-before
hvlog-before: build-before
Expand All @@ -492,73 +494,38 @@ clean-build:
-$(RM) $(HVLOGBIN) $(HVLOGBIN:%.exe=%.map)
-$(RM) $(HVLOGBIN) $(HVLOGBIN:%.exe=%.pdb)
-$(RM) bin/keeperfx.dll
-$(RM) $(LIBS) $(GENSRC)
-$(RM) $(GENSRC)
-$(RM) res/*.ico
-$(RM) obj/keeperfx.*

$(BIN): $(GENSRC) $(STDOBJS) $(STD_MAIN_OBJ) $(LIBS) std-before
$(BIN): $(GENSRC) $(STDOBJS) $(STD_MAIN_OBJ) std-before
-$(ECHO) 'Building target: $@'
$(CPP) -o "$@" $(STDOBJS) $(STD_MAIN_OBJ) $(LDFLAGS)
ifdef CV2PDB
$(CV2PDB) -C "$@"
endif
-$(ECHO) ' '

$(HVLOGBIN): $(GENSRC) $(HVLOGOBJS) $(HVLOG_MAIN_OBJ) $(LIBS) hvlog-before
$(HVLOGBIN): $(GENSRC) $(HVLOGOBJS) $(HVLOG_MAIN_OBJ) hvlog-before
-$(ECHO) 'Building target: $@'
$(CPP) -o "$@" $(HVLOGOBJS) $(HVLOG_MAIN_OBJ) $(LDFLAGS)
ifdef CV2PDB
$(CV2PDB) -C "$@"
endif
-$(ECHO) ' '

$(TEST_BIN): $(GENSRC) $(STDOBJS) $(TESTS_OBJ) $(LIBS) $(CU_OBJS) std-before
$(TEST_BIN): $(GENSRC) $(STDOBJS) $(TESTS_OBJ) $(CU_OBJS) std-before
-$(ECHO) 'Building target: $@'
$(CPP) -o "$@" $(TESTS_OBJ) $(STDOBJS) $(CU_OBJS) $(LDFLAGS)
ifdef CV2PDB
$(CV2PDB) -C "$@"
endif

obj/std/spng.o obj/hvlog/spng.o: deps/libspng/spng/spng.c deps/zlib/libz.a
-$(ECHO) 'Building file: $<'
$(CC) $(CFLAGS) -I"deps/zlib" -I"deps/libspng/spng" -o"$@" "$<"
-$(ECHO) ' '

obj/std/json/%.o obj/hvlog/json/%.o: deps/centijson/src/%.c
-$(ECHO) 'Building file: $<'
$(CC) $(CFLAGS) -o"$@" "$<"
-$(ECHO) ' '

obj/std/centitoml/toml_api.o obj/hvlog/centitoml/toml_api.o: deps/centitoml/toml_api.c build-before
-$(ECHO) 'Building file: $<'
$(CC) $(CFLAGS) -o"$@" "$<"
-$(ECHO) ' '

obj/std/unzip.o obj/hvlog/unzip.o: deps/zlib/contrib/minizip/unzip.c
-$(ECHO) 'Building file: $<'
$(CC) $(CFLAGS) -Wno-shadow -I"deps/zlib" -o"$@" "$<"
-$(ECHO) ' '

obj/std/astronomy.o obj/hvlog/astronomy.o: deps/astronomy/astronomy.c
-$(ECHO) 'Building file: $<'
$(CC) $(CFLAGS) -o"$@" "$<"
-$(ECHO) ' '

obj/std/ioapi.o obj/hvlog/ioapi.o: deps/zlib/contrib/minizip/ioapi.c
-$(ECHO) 'Building file: $<'
$(CC) $(CFLAGS) -I"deps/zlib" -o"$@" "$<"
-$(ECHO) ' '

obj/std/lvl_filesdk1.o obj/hvlog/lvl_filesdk1.o: src/lvl_filesdk1.c deps/zlib/contrib/minizip/unzip.c $(GENSRC)
-$(ECHO) 'Building file: $<'
$(CC) $(CFLAGS) -I"deps/zlib" -I"deps/zlib/contrib/minizip" -o"$@" "$<"
-$(ECHO) ' '

obj/std/custom_sprites.o obj/hvlog/custom_sprites.o: src/custom_sprites.c deps/zlib/contrib/minizip/unzip.c $(GENSRC)
-$(ECHO) 'Building file: $<'
$(CC) $(CFLAGS) -I"deps/libspng/spng" -I"deps/zlib" -I"deps/zlib/contrib/minizip" -o"$@" "$<"
-$(ECHO) ' '

obj/tests/%.o: tests/%.cpp $(GENSRC)
-$(ECHO) 'Building file: $<'
$(CPP) $(CXXFLAGS) -I"src/" $(CU_INC) -o"$@" "$<"
Expand Down Expand Up @@ -613,26 +580,48 @@ libexterns: libexterns.mk

clean-libexterns: libexterns.mk
-$(MAKE) -f libexterns.mk clean-libexterns
-$(MAKE) -f enet.mk clean
-cd deps/zlib && $(MAKE) -f win32/Makefile.gcc clean
-cd deps/zlib && git checkout Makefile zconf.h
-$(RM) -rf deps/enet deps/zlib deps/spng deps/astronomy deps/centijson
-$(RM) libexterns

deps/centijson/src/json.c deps/centijson/src/value.c deps/centijson/src/json-dom.c: build-before
deps/libspng/spng/spng.c: build-before
deps/zlib/contrib/minizip/unzip.c deps/zlib/contrib/minizip/ioapi.c: build-before
deps/astronomy/astronomy.c: build-before
deps/enet deps/zlib deps/spng deps/astronomy deps/centijson:
$(MKDIR) $@

src/api.c: deps/centijson/include/json.h
src/bflib_enet.cpp: deps/enet/include/enet/enet.h
src/custom_sprites.c: deps/zlib/include/zlib.h deps/spng/include/spng.h deps/centijson/include/json.h
src/moonphase.c: deps/astronomy/include/astronomy.h
deps/centitoml/toml_api.c: deps/centijson/include/json.h
deps/centitoml/toml_conv.c: deps/centijson/include/json.h

deps/enet-mingw32.tar.gz:
curl -Lso $@ "https://github.com/dkfans/kfx-deps/releases/download/initial/enet-mingw32.tar.gz"

deps/enet/include/enet/enet.h: deps/enet-mingw32.tar.gz | deps/enet
tar xzmf $< -C deps/enet

deps/zlib-mingw32.tar.gz:
curl -Lso $@ "https://github.com/dkfans/kfx-deps/releases/download/initial/zlib-mingw32.tar.gz"

deps/zlib/include/zlib.h: deps/zlib-mingw32.tar.gz | deps/zlib
tar xzmf $< -C deps/zlib

deps/spng-mingw32.tar.gz:
curl -Lso $@ "https://github.com/dkfans/kfx-deps/releases/download/initial/spng-mingw32.tar.gz"

deps/spng/include/spng.h: deps/spng-mingw32.tar.gz | deps/spng
tar xzmf $< -C deps/spng

deps/astronomy-mingw32.tar.gz:
curl -Lso $@ "https://github.com/dkfans/kfx-deps/releases/download/initial/astronomy-mingw32.tar.gz"

deps/zlib/configure.log:
git submodule sync && git submodule update --init
touch deps/zlib/configure.log
cd deps/zlib && ./configure --static
deps/astronomy/include/astronomy.h: deps/astronomy-mingw32.tar.gz | deps/astronomy
tar xzmf $< -C deps/astronomy

deps/zlib/libz.a: deps/zlib/configure.log
cd deps/zlib && $(MAKE) -f win32/Makefile.gcc PREFIX=$(CROSS_COMPILE) libz.a
deps/centijson-mingw32.tar.gz:
curl -Lso $@ "https://github.com/dkfans/kfx-deps/releases/download/initial/centijson-mingw32.tar.gz"

obj/enet.a:
$(MAKE) -f enet.mk PREFIX=$(CROSS_COMPILE) WARNFLAGS=$(WARNFLAGS) obj/enet.a
deps/centijson/include/json.h: deps/centijson-mingw32.tar.gz | deps/centijson
tar xzmf $< -C deps/centijson

include tool_png2ico.mk
include tool_pngpal2raw.mk
Expand Down
2 changes: 0 additions & 2 deletions deps/astronomy/.gitignore

This file was deleted.

Loading

0 comments on commit 70ee04e

Please sign in to comment.