Skip to content

Commit

Permalink
Support ccache, distcc etc. in Makefile - and fix files missed from c…
Browse files Browse the repository at this point in the history
…lean target (#1218)

* Makefile: support C compiler wrappers like ccache

Set the Makefile variable CWRAPPER to "ccache" (or distcc or something
else) to automatically wrap gcc and g++ invocations.

* Makefile: `clean` missed out some files - fix
  • Loading branch information
rdowner authored and midwan committed Jan 20, 2024
1 parent 941a237 commit f8bc2be
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Makefile
Expand Up @@ -348,6 +348,11 @@ CXX ?= g++
STRIP ?= strip
PROG = amiberry

ifdef CWRAPPER
CC := $(CWRAPPER) $(CC)
CXX := $(CWRAPPER) $(CXX)
endif

#
# SDL2 options
#
Expand Down Expand Up @@ -684,18 +689,19 @@ endif
clean:
$(RM) $(PROG) $(PROG)-debug $(C_OBJS) $(OBJS) $(ASMS) $(DEPS)
$(MAKE) -C external/libguisan clean && $(RM) external/libguisan/libguisan.a
-cmake --build external/mt32emu/build --target clean
-cmake --build external/mt32emu/build --target clean
-rm external/mt32emu/build
-rm external/mt32emu/libmt32emu.a

cleanprofile:
$(RM) $(OBJS:%.o=%.gcda)
$(MAKE) -C external/libguisan cleanprofile

guisan:
$(MAKE) -C external/libguisan
$(MAKE) -C external/libguisan CC="$(CC)" CXX="$(CXX)"

mt32emu:
cmake -DCMAKE_BUILD_TYPE=Release -Dlibmt32emu_SHARED=FALSE -S external/mt32emu -B external/mt32emu/build
cmake $(if $(CWRAPPER),-DCMAKE_CXX_COMPILER_LAUNCHER=$(CWRAPPER),) -DCMAKE_BUILD_TYPE=Release -Dlibmt32emu_SHARED=FALSE -S external/mt32emu -B external/mt32emu/build
cmake --build external/mt32emu/build --target all --parallel
cp external/mt32emu/build/libmt32emu.a external/mt32emu/

Expand Down

0 comments on commit f8bc2be

Please sign in to comment.