Skip to content

Commit

Permalink
Reduce Makefile prints to clean build output
Browse files Browse the repository at this point in the history
Makefile and CC prints can be useful, but most of the time they are
overwhelming especially for non-C programmers. This simplifies
the prints.

To re-enable, set `V=1` like is common with many Makefile/C projects.
For example `V=1 make`, `V=1 mix compile`, etc.
  • Loading branch information
jjcarstens committed Dec 18, 2023
1 parent 39e4279 commit 65c4ec5
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,18 @@ docs_report:
MIX_ENV=docs mix inch.report

$(BUILD)/%.o: c_src/%.c
@echo " CC $(notdir $@)"
$(CC) -c $(ERL_CFLAGS) $(CFLAGS) -o $@ $<

$(PREFIX)/line.so: $(BUILD)/line.o
$(CC) $^ $(ERL_LDFLAGS) $(LDFLAGS) -o $@

$(PREFIX)/matrix.so: $(BUILD)/matrix.o
$(CC) $^ $(ERL_LDFLAGS) $(LDFLAGS) -o $@

$(PREFIX)/bitmap.so: $(BUILD)/bitmap.o
$(CC) $^ $(ERL_LDFLAGS) $(LDFLAGS) -o $@
$(PREFIX)/%.so: $(BUILD)/%.o
@echo " LD $(notdir $@)"
$(CC) $< $(ERL_LDFLAGS) $(LDFLAGS) -o $@

$(PREFIX) $(BUILD):
mkdir -p $@

clean:
$(RM) $(NIF) c_src/*.o

# Don't echo commands unless the caller exports "V=1"
${V}.SILENT:

0 comments on commit 65c4ec5

Please sign in to comment.