Makefile tweaks for the utilities.

- print compilation status for building the final executable
- add 'cleanutils' target in build/Makefile
- don't link against pthread, seems unnecessary
- don't build nedmalloc.o when not requested in Makefile.common

git-svn-id: https://svn.eduke32.com/eduke32@2403 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-03-04 20:11:49 +00:00
parent 60a27d6bb0
commit 147a41d296
2 changed files with 44 additions and 24 deletions

View file

@ -56,8 +56,11 @@ endif
include Makefile.shared
UTILLIBS=-lpthread
UTILLIBS= # -lpthread
UTILADDOBJS=
ifneq (0,$(NEDMALLOC))
UTILADDOBJS+= $(OBJ)/nedmalloc.$o
endif
ENGINEOBJS=
ifeq (0,$(NOASM))
@ -160,7 +163,7 @@ endif
OURCFLAGS+= $(BUILDCFLAGS)
.SILENT:
.PHONY: clean veryclean all utils enginelib editorlib
.PHONY: clean cleanutils veryclean all utils enginelib editorlib
# TARGETS
@ -183,29 +186,39 @@ $(OBJ)/$(EDITORLIB): $(EDITOROBJS)
if $(AR) rc $@ $^; then $(ARCHIVE_OK); else $(ARCHIVE_FAILED); fi
$(RANLIB) $@
pragmacheck$(EXESUFFIX): $(OBJ)/pragmacheck.$o $(OBJ)/pragmas.$o
$(CC) $(subst -Dmain=app_main,,$(OURCFLAGS)) -o $@ $^
#pragmacheck$(EXESUFFIX): $(OBJ)/pragmacheck.$o $(OBJ)/pragmas.$o
# $(CC) $(subst -Dmain=app_main,,$(OURCFLAGS)) -o $@ $^
kextract$(EXESUFFIX): $(OBJ)/kextract.$o $(OBJ)/compat.$o $(OBJ)/nedmalloc.$o
$(CC) -o $@ $^ $(UTILLIBS)
kgroup$(EXESUFFIX): $(OBJ)/kgroup.$o $(OBJ)/compat.$o $(OBJ)/nedmalloc.$o
$(CC) -o $@ $^ $(UTILLIBS)
transpal$(EXESUFFIX): $(OBJ)/transpal.$o $(OBJ)/pragmas.$o $(OBJ)/compat.$o $(OBJ)/nedmalloc.$o
$(CC) -o $@ $^ $(UTILLIBS)
wad2art$(EXESUFFIX): $(OBJ)/wad2art.$o $(OBJ)/pragmas.$o $(OBJ)/compat.$o $(OBJ)/nedmalloc.$o
$(CC) -o $@ $^ $(UTILLIBS)
wad2map$(EXESUFFIX): $(OBJ)/wad2map.$o $(OBJ)/pragmas.$o $(OBJ)/compat.$o $(OBJ)/nedmalloc.$o
$(CC) -o $@ $^ $(UTILLIBS)
md2tool$(EXESUFFIX): $(OBJ)/md2tool.$o $(OBJ)/compat.$o $(OBJ)/nedmalloc.$o
$(CC) -o $@ $^ $(UTILLIBS)
kextract$(EXESUFFIX): $(OBJ)/kextract.$o $(OBJ)/compat.$o $(UTILADDOBJS)
$(ONESTEP_STATUS)
if $(CC) -o $@ $^ $(UTILLIBS); then $(ONESTEP_OK); fi
kgroup$(EXESUFFIX): $(OBJ)/kgroup.$o $(OBJ)/compat.$o $(UTILADDOBJS)
$(ONESTEP_STATUS)
if $(CC) -o $@ $^ $(UTILLIBS); then $(ONESTEP_OK); fi
transpal$(EXESUFFIX): $(OBJ)/transpal.$o $(OBJ)/pragmas.$o $(OBJ)/compat.$o $(UTILADDOBJS)
$(ONESTEP_STATUS)
if $(CC) -o $@ $^ $(UTILLIBS); then $(ONESTEP_OK); fi
wad2art$(EXESUFFIX): $(OBJ)/wad2art.$o $(OBJ)/pragmas.$o $(OBJ)/compat.$o $(UTILADDOBJS)
$(ONESTEP_STATUS)
if $(CC) -o $@ $^ $(UTILLIBS); then $(ONESTEP_OK); fi
wad2map$(EXESUFFIX): $(OBJ)/wad2map.$o $(OBJ)/pragmas.$o $(OBJ)/compat.$o $(UTILADDOBJS)
$(ONESTEP_STATUS)
if $(CC) -o $@ $^ $(UTILLIBS); then $(ONESTEP_OK); fi
md2tool$(EXESUFFIX): $(OBJ)/md2tool.$o $(OBJ)/compat.$o $(UTILADDOBJS)
$(ONESTEP_STATUS)
if $(CC) -o $@ $^ $(UTILLIBS); then $(ONESTEP_OK); fi
generateicon$(EXESUFFIX): $(OBJ)/generateicon.$o $(OBJ)/kplib.$o
$(CC) -o $@ $^ $(UTILLIBS)
cacheinfo$(EXESUFFIX): $(OBJ)/cacheinfo.$o $(OBJ)/compat.$o $(OBJ)/nedmalloc.$o
$(CC) -o $@ $^ $(UTILLIBS)
$(ONESTEP_STATUS)
if $(CC) -o $@ $^ $(UTILLIBS); then $(ONESTEP_OK); fi
cacheinfo$(EXESUFFIX): $(OBJ)/cacheinfo.$o $(OBJ)/compat.$o $(UTILADDOBJS)
$(ONESTEP_STATUS)
if $(CC) -o $@ $^ $(UTILLIBS); then $(ONESTEP_OK); fi
enumdisplay$(EXESUFFIX): src/misc/enumdisplay.c
$(CC) -g -Os -o $@ $^ $(UTILLIBS) -I$(DXROOT)/include -lgdi32
$(ONESTEP_STATUS)
if $(CC) -g -Os -o $@ $^ $(UTILLIBS) -I$(DXROOT)/include -lgdi32; then $(ONESTEP_OK); fi
mapdump$(EXESUFFIX): $(OBJ)/mapdump.$o
$(CC) -o $@ $^ $(UTILLIBS)
$(ONESTEP_STATUS)
if $(CC) -o $@ $^ $(UTILLIBS); then $(ONESTEP_OK); fi
# DEPENDENCIES
include Makefile.deps
@ -254,8 +267,11 @@ $(RSRC)/editor_banner.c: $(RSRC)/build.bmp
clean:
-rm -f $(OBJ)/*
veryclean: clean
-rm -f $(ENGINELIB) $(EDITORLIB) $(UTILS)
cleanutils:
-rm -f $(UTILS)
veryclean: clean cleanutils
-rm -f $(ENGINELIB) $(EDITORLIB)
.PHONY: fixlineends
fixlineends:

View file

@ -223,7 +223,9 @@ BUILD_STARTED = printf "\033[K\033[1;36mBuild started using \"$(CC) $(OURCFLAGS)
BUILD_ECHOFLAGS = printf "\033[K\033[1;36mEnded compilation in this directory using \"$(CC) $(OURCFLAGS)\"\033[0m\n"
BUILD_FINISHED = printf "\033[K\033[1;36mBuild successful:\033[0m\n"
COMPILE_STATUS = printf "\033[K\033[0mBuilding object \033[1m$@\033[0m...\033[0m\r"
ONESTEP_STATUS = printf "\033[K\033[0mBuilding executable \033[1m$@\033[0m...\033[0m\r"
COMPILE_OK = printf "\033[K\033[0;32mBuilt object \033[1;32m$@\033[0;32m \033[0m\n"
ONESTEP_OK = printf "\033[K\033[0;32mBuilt executable \033[1;32m$@\033[0;32m \033[0m\n"
COMPILE_FAILED = printf "\033[K\033[0;31mFailed building \033[1;31m$@\033[0;31m from\033[0m \033[1;31m$<\033[0;31m!\033[0m\n"; exit 1
ARCHIVE_STATUS = printf "\033[K\033[0mCreating library archive \033[1m$@\033[0m...\033[0m\r"
ARCHIVE_OK = printf "\033[K\033[0;32mCreated library archive \033[1;32m$@\033[0;32m \033[0m\n"
@ -236,7 +238,9 @@ BUILD_STARTED =
BUILD_ECHOFLAGS=
BUILD_FINISHED =
COMPILE_STATUS =
ONESTEP_STATUS =
COMPILE_OK = true
ONESTEP_OK = true
COMPILE_FAILED = false; exit 1
ARCHIVE_STATUS =
ARCHIVE_OK = true