Various improvements to Makefile.

This commit is contained in:
LoRd_MuldeR 2020-10-02 19:01:29 +02:00
parent d1094c350a
commit 1606859dff
5 changed files with 318 additions and 102 deletions

349
Makefile
View File

@ -37,92 +37,293 @@ endif
CFLAGS += -municode -mwindows -march=$(MARCH) -mtune=$(MTUNE)
LDFLAGS = -lcomctl32
.PHONY: all init resources build strip clean
# ==========================================================
# Targets
# ==========================================================
ifeq ($(DEBUG),0)
all: strip
else
all: build
endif
.PHONY: default
default: all
.PHONY: init
init:
mkdir -p bin
mkdir -p obj
.PHONY: resources
resources: init
windres -o obj/common.$(CPU_ARCH).o res/common.rc
windres -o obj/splash_screen.$(CPU_ARCH).o res/splash_screen.rc
windres -o obj/registry.$(CPU_ARCH).o res/registry.rc
build: init resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH).exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_nowait.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_nowait_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_nowait_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_nowait_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_registry.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_registry_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_registry_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_registry_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_registry_nowait.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_registry_nowait_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_registry_nowait_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_registry_nowait_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_nowait.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_nowait_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_nowait_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_nowait_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
strip: build
strip bin/launch5j_$(CPU_ARCH).exe
strip bin/launch5j_$(CPU_ARCH)_noenc.exe
strip bin/launch5j_$(CPU_ARCH)_nosplash.exe
strip bin/launch5j_$(CPU_ARCH)_nosplash_noenc.exe
strip bin/launch5j_$(CPU_ARCH)_nowait.exe
strip bin/launch5j_$(CPU_ARCH)_nowait_noenc.exe
strip bin/launch5j_$(CPU_ARCH)_nowait_nosplash.exe
strip bin/launch5j_$(CPU_ARCH)_nowait_nosplash_noenc.exe
strip bin/launch5j_$(CPU_ARCH)_registry.exe
strip bin/launch5j_$(CPU_ARCH)_registry_noenc.exe
strip bin/launch5j_$(CPU_ARCH)_registry_nosplash.exe
strip bin/launch5j_$(CPU_ARCH)_registry_nosplash_noenc.exe
strip bin/launch5j_$(CPU_ARCH)_registry_nowait.exe
strip bin/launch5j_$(CPU_ARCH)_registry_nowait_noenc.exe
strip bin/launch5j_$(CPU_ARCH)_registry_nowait_nosplash.exe
strip bin/launch5j_$(CPU_ARCH)_registry_nowait_nosplash_noenc.exe
strip bin/launch5j_$(CPU_ARCH)_wrapped.exe
strip bin/launch5j_$(CPU_ARCH)_wrapped_noenc.exe
strip bin/launch5j_$(CPU_ARCH)_wrapped_nosplash.exe
strip bin/launch5j_$(CPU_ARCH)_wrapped_nosplash_noenc.exe
strip bin/launch5j_$(CPU_ARCH)_wrapped_nowait.exe
strip bin/launch5j_$(CPU_ARCH)_wrapped_nowait_noenc.exe
strip bin/launch5j_$(CPU_ARCH)_wrapped_nowait_nosplash.exe
strip bin/launch5j_$(CPU_ARCH)_wrapped_nowait_nosplash_noenc.exe
strip bin/launch5j_$(CPU_ARCH)_wrapped_registry.exe
strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_noenc.exe
strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_nosplash.exe
strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_nosplash_noenc.exe
strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait.exe
strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait_noenc.exe
strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait_nosplash.exe
strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait_nosplash_noenc.exe
.PHONY: clean
clean: init
$(RM) bin/*.$(SUFFIX)
$(RM) obj/*.o
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Binaries
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.PHONY: l5j
l5j: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH).exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH).exe
endif
.PHONY: l5j_noenc
l5j_noenc: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_noenc.exe
endif
.PHONY: l5j_nosplash
l5j_nosplash: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nosplash.exe
endif
.PHONY: l5j_nosplash_noenc
l5j_nosplash_noenc: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nosplash_noenc.exe
endif
.PHONY: l5j_nowait
l5j_nowait: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_nowait.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nowait.exe
endif
.PHONY: l5j_nowait_noenc
l5j_nowait_noenc: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_nowait_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nowait_noenc.exe
endif
.PHONY: l5j_nowait_nosplash
l5j_nowait_nosplash: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_nowait_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nowait_nosplash.exe
endif
.PHONY: l5j_nowait_nosplash_noenc
l5j_nowait_nosplash_noenc: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_nowait_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nowait_nosplash_noenc.exe
endif
.PHONY: l5j_registry
l5j_registry: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_registry.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_registry.exe
endif
.PHONY: l5j_registry_noenc
l5j_registry_noenc: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_registry_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_registry_noenc.exe
endif
.PHONY: l5j_registry_nosplash
l5j_registry_nosplash: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_registry_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_registry_nosplash.exe
endif
.PHONY: l5j_registry_nosplash_noenc
l5j_registry_nosplash_noenc: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_registry_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_registry_nosplash_noenc.exe
endif
.PHONY: l5j_registry_nowait
l5j_registry_nowait: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_registry_nowait.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_registry_nowait.exe
endif
.PHONY: l5j_registry_nowait_noenc
l5j_registry_nowait_noenc: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_registry_nowait_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_registry_nowait_noenc.exe
endif
.PHONY: l5j_registry_nowait_nosplash
l5j_registry_nowait_nosplash: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_registry_nowait_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_registry_nowait_nosplash.exe
endif
.PHONY: l5j_registry_nowait_nosplash_noenc
l5j_registry_nowait_nosplash_noenc: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_registry_nowait_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_registry_nowait_nosplash_noenc.exe
endif
.PHONY: l5j_wrapped
l5j_wrapped: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped.exe
endif
.PHONY: l5j_wrapped_noenc
l5j_wrapped_noenc: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_noenc.exe
endif
.PHONY: l5j_wrapped_nosplash
l5j_wrapped_nosplash: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_nosplash.exe
endif
.PHONY: l5j_wrapped_nosplash_noenc
l5j_wrapped_nosplash_noenc: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_nosplash_noenc.exe
endif
.PHONY: l5j_wrapped_nowait
l5j_wrapped_nowait: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_nowait.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_nowait.exe
endif
.PHONY: l5j_wrapped_nowait_noenc
l5j_wrapped_nowait_noenc: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_nowait_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_nowait_noenc.exe
endif
.PHONY: l5j_wrapped_nowait_nosplash
l5j_wrapped_nowait_nosplash: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_nowait_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_nowait_nosplash.exe
endif
.PHONY: l5j_wrapped_nowait_nosplash_noenc
l5j_wrapped_nowait_nosplash_noenc: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_nowait_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_nowait_nosplash_noenc.exe
endif
.PHONY: l5j_wrapped_registry
l5j_wrapped_registry: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_registry.exe
endif
.PHONY: l5j_wrapped_registry_noenc
l5j_wrapped_registry_noenc: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_noenc.exe
endif
.PHONY: l5j_wrapped_registry_nosplash
l5j_wrapped_registry_nosplash: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_nosplash.exe
endif
.PHONY: l5j_wrapped_registry_nosplash_noenc
l5j_wrapped_registry_nosplash_noenc: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_nosplash_noenc.exe
endif
.PHONY: l5j_wrapped_registry_nowait
l5j_wrapped_registry_nowait: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait.exe
endif
.PHONY: l5j_wrapped_registry_nowait_noenc
l5j_wrapped_registry_nowait_noenc: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait_noenc.exe
endif
.PHONY: l5j_wrapped_registry_nowait_nosplash
l5j_wrapped_registry_nowait_nosplash: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait_nosplash.exe
endif
.PHONY: l5j_wrapped_registry_nowait_nosplash_noenc
l5j_wrapped_registry_nowait_nosplash_noenc: resources
$(CC) $(CFLAGS) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait_nosplash_noenc.exe
endif
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ALL
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.PHONY: all
all: \
l5j \
l5j_noenc \
l5j_nosplash \
l5j_nosplash_noenc \
l5j_nowait \
l5j_nowait_noenc \
l5j_nowait_nosplash \
l5j_nowait_nosplash_noenc \
l5j_registry \
l5j_registry_noenc \
l5j_registry_nosplash \
l5j_registry_nosplash_noenc \
l5j_registry_nowait \
l5j_registry_nowait_noenc \
l5j_registry_nowait_nosplash \
l5j_registry_nowait_nosplash_noenc \
l5j_wrapped \
l5j_wrapped_noenc \
l5j_wrapped_nosplash \
l5j_wrapped_nosplash_noenc \
l5j_wrapped_nowait \
l5j_wrapped_nowait_noenc \
l5j_wrapped_nowait_nosplash \
l5j_wrapped_nowait_nosplash_noenc \
l5j_wrapped_registry \
l5j_wrapped_registry_noenc \
l5j_wrapped_registry_nosplash \
l5j_wrapped_registry_nosplash_noenc \
l5j_wrapped_registry_nowait \
l5j_wrapped_registry_nowait_noenc \
l5j_wrapped_registry_nowait_nosplash \
l5j_wrapped_registry_nowait_nosplash_noenc

View File

@ -22,7 +22,7 @@ for %%m in (32,64) do (
echo Build %%m-Bit
echo ========================================================================
echo.
call "%MSYS2_DIR%\msys2_shell.cmd" -mingw%%m -no-start -defterm -where "%~dp0" -c "make -B"
call "%MSYS2_DIR%\msys2_shell.cmd" -mingw%%m -no-start -defterm -where "%~dp0" -c "make -B -j8"
if not "!ERRORLEVEL!"=="0" goto:build_completed
echo.
)

View File

@ -1,3 +0,0 @@
clean: init
$(RM) bin/*.$(SUFFIX)
$(RM) obj/*.o

View File

@ -37,19 +37,29 @@ endif
CFLAGS += -municode -mwindows -march=$(MARCH) -mtune=$(MTUNE)
LDFLAGS = -lcomctl32
.PHONY: all init resources build strip clean
# ==========================================================
# Targets
# ==========================================================
ifeq ($(DEBUG),0)
all: strip
else
all: build
endif
.PHONY: default
default: all
.PHONY: init
init:
mkdir -p bin
mkdir -p obj
.PHONY: resources
resources: init
windres -o obj/common.$(CPU_ARCH).o res/common.rc
windres -o obj/splash_screen.$(CPU_ARCH).o res/splash_screen.rc
windres -o obj/registry.$(CPU_ARCH).o res/registry.rc
.PHONY: clean
clean: init
$(RM) bin/*.$(SUFFIX)
$(RM) obj/*.o
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Binaries
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -32,31 +32,34 @@ public class Generator {
private final static Pattern RTRIM = Pattern.compile("\\s+$");
public static void main(String[] args) throws IOException {
final List<String> filenNames = new ArrayList<String>();
final List<String> targets = new ArrayList<String>();
final PrintStream out = new PrintStream(System.out, true, StandardCharsets.UTF_8.name());
outputTemplate(out, "header");
out.println("build: init resources");
for (int wrapped = 0; wrapped < 2; ++wrapped) {
for (int registry = 0; registry < 2; ++registry) {
for (int stayAlive = 1; stayAlive > -1; --stayAlive) {
for (int enableSplash = 1; enableSplash > -1; --enableSplash) {
for (int encArgs = 1; encArgs > -1; --encArgs) {
out.println(generateCommand(filenNames, wrapped, registry, stayAlive, enableSplash, encArgs));
out.println(generateCommand(targets, wrapped, registry, stayAlive, enableSplash, encArgs));
}
}
}
}
}
out.println("\nstrip: build");
for (final String fileName : filenNames) {
out.printf("\tstrip %s\n", fileName);
}
out.println("# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
out.println("# ALL");
out.println("# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
out.println();
outputTemplate(out, "footer");
out.println(".PHONY: all");
out.print("all:");
for(final String target: targets) {
out.printf(" \\\n %s", target);
}
out.println("\n");
}
private static void outputTemplate(final PrintStream out, final String name) throws IOException {
@ -87,32 +90,37 @@ public class Generator {
out.println();
}
private static String generateCommand(final List<String> outNames, final int wrapped, final int registry, final int stayAlive, final int enableSplash, final int encArgs) {
final String fileName = String.format("bin/launch5j_$(CPU_ARCH)%s.exe",
generateNameSuffix(wrapped, registry, stayAlive, enableSplash, encArgs));
final StringBuilder cmdLine = new StringBuilder(
String.format("\t$(CC) $(CFLAGS) " +
private static String generateCommand(final List<String> targets, final int wrapped, final int registry, final int stayAlive, final int enableSplash, final int encArgs) {
final String nameSuffix = generateNameSuffix(wrapped, registry, stayAlive, enableSplash, encArgs);
final String targetName = "l5j" + nameSuffix;
targets.add(targetName);
final StringBuilder cmdLine = new StringBuilder();
cmdLine.append(String.format(".PHONY: %s\n", targetName));
cmdLine.append(String.format("%s: resources\n", targetName));
cmdLine.append(String.format("\t$(CC) $(CFLAGS) " +
"-DL5J_JAR_FILE_WRAPPED=%d " +
"-DL5J_DETECT_REGISTRY=%d " +
"-DL5J_STAY_ALIVE=%d " +
"-DL5J_ENABLE_SPLASH=%d " +
"-DL5J_ENCODE_ARGS=%d " +
"-o %s " +
"-o bin/launch5j_$(CPU_ARCH)%s.exe " +
"src/head.c obj/common.$(CPU_ARCH).o",
wrapped,
registry,
stayAlive,
enableSplash,
encArgs,
fileName));
nameSuffix));
if (enableSplash > 0) {
cmdLine.append(" obj/splash_screen.$(CPU_ARCH).o");
}
if (registry > 0) {
cmdLine.append(" obj/registry.$(CPU_ARCH).o");
}
cmdLine.append(" $(LDFLAGS)");
outNames.add(fileName);
cmdLine.append(" $(LDFLAGS)\n");
cmdLine.append("ifeq ($(DEBUG),0)\n");
cmdLine.append(String.format("\tstrip bin/launch5j_$(CPU_ARCH)%s.exe\n", nameSuffix));
cmdLine.append("endif\n");
return cmdLine.toString();
}