Skip to content

Commit

Permalink
GNUmakefile: use the builtin shell macro for increased portability an…
Browse files Browse the repository at this point in the history
…d compatibility with CLion
  • Loading branch information
fridtjof authored and vifino committed Jan 29, 2021
1 parent 68330dc commit 07c3c9e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,13 @@ FORCE:

# --- Generic object conversion rule begins here ---
%.o: %.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ `cat $(@:.o=.incs) 2>/dev/null || true` $^
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(shell cat $(@:.o=.incs) 2>/dev/null || true) $^

# --- Module compile info begins here ---
# To build modules/X.so, link src/modules/X.o with information in an optional .libs file
modules/%.so: src/modules/%.o $(ML_OBJECTS)
mkdir -p modules
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(LDSOFLAGS) -o $@ $^ `cat src/modules/$*.libs 2>/dev/null || true`
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(LDSOFLAGS) -o $@ $^ $(shell cat src/modules/$*.libs 2>/dev/null || true)

# -- k2wrap/k2link
src/slloadcore.gen.c: src/plugin.h static/k2link
Expand Down Expand Up @@ -219,8 +219,8 @@ libsled.a: $(OBJECTS) $(ML_OBJECTS)
# --- The actual build begins here ---
ifeq ($(STATIC),0)
$(PROJECT): $(OBJECTS)
$(CC) $(CPPFLAGS) $(CFLAGS) -rdynamic $(LDFLAGS) -o $@ $^ `cat $(PLATFORM_LIBS) $(MODULES_STATIC_LIBS) 2>/dev/null || true` $(LIBS)
$(CC) $(CPPFLAGS) $(CFLAGS) -rdynamic $(LDFLAGS) -o $@ $^ $(shell cat $(PLATFORM_LIBS) $(MODULES_STATIC_LIBS) 2>/dev/null || true) $(LIBS)
else
$(PROJECT): $(OBJECTS) $(ML_OBJECTS)
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) `cat $(PLATFORM_LIBS) $(MODULES_STATIC_LIBS) 2>/dev/null || true`
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(shell cat $(PLATFORM_LIBS) $(MODULES_STATIC_LIBS) 2>/dev/null || true)
endif

0 comments on commit 07c3c9e

Please sign in to comment.