Skip to content

Commit

Permalink
Fix build targets in Makefile.prebuild
Browse files Browse the repository at this point in the history
- config.h was used as target even when it wasn't generated.
  This only worked because the 'dummy' target always triggers
  a full rebuild.
  It is however better to specify the exact target that is to
  be rebuilt do avoid confusion.
- Explicitly mark 'dummy' as a 'phony' target.

Signed-off-by: Egbert Eich <[email protected]>
  • Loading branch information
e4t committed Apr 5, 2022
1 parent 4dbdc28 commit 4541288
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile.prebuild
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ all: getarch_2nd
./getarch_2nd 0 >> $(TARGET_MAKE)
./getarch_2nd 1 >> $(TARGET_CONF)

config.h : c_check f_check getarch
$(TARGET_CONF): c_check f_check getarch
perl ./c_check $(TARGET_MAKE) $(TARGET_CONF) $(CC) $(TARGET_FLAGS) $(CFLAGS)
ifneq ($(ONLY_CBLAS), 1)
perl ./f_check $(TARGET_MAKE) $(TARGET_CONF) $(FC) $(TARGET_FLAGS)
Expand All @@ -74,11 +74,13 @@ getarch : getarch.c cpuid.S dummy $(CPUIDEMU)
avx512=$$(perl c_check - - $(CC) $(TARGET_FLAGS) $(CFLAGS) | grep NO_AVX512); \
$(HOSTCC) $(HOST_CFLAGS) $(EXFLAGS) $${avx512:+-D$${avx512}} -o $(@F) getarch.c cpuid.S $(CPUIDEMU)

getarch_2nd : getarch_2nd.c config.h dummy
getarch_2nd : getarch_2nd.c $(TARGET_CONF) dummy
ifndef TARGET_CORE
$(HOSTCC) -I. $(HOST_CFLAGS) -o $(@F) getarch_2nd.c
else
$(HOSTCC) -I. $(HOST_CFLAGS) -DBUILD_KERNEL -o $(@F) getarch_2nd.c
endif

dummy:

.PHONY: dummy

0 comments on commit 4541288

Please sign in to comment.