Skip to content

Commit

Permalink
Makefile: give up on auto deps
Browse files Browse the repository at this point in the history
  • Loading branch information
attipaci committed Oct 17, 2024
1 parent a3ac392 commit 71fa7c4
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
# You can include this in your Makefile also.
# ============================================================================


# Regular object files
$(OBJ)/%.o: %.c dep/%.d $(OBJ) Makefile
$(OBJ)/%.o: %.c $(OBJ) Makefile
$(CC) -o $@ -c $(CPPFLAGS) $(CFLAGS) $<

# Share library recipe
Expand All @@ -33,7 +32,7 @@ dep $(OBJ) $(LIB) $(BIN) apidoc:
# Remove intermediate files locally
.PHONY: clean-local
clean-local:
rm -rf obj dep
rm -rf obj

# Remove all locally built files, effectively restoring the repo to its
# pristine state
Expand Down Expand Up @@ -61,11 +60,3 @@ dox: README.md Doxyfile apidoc $(SRC) $(INC)
@echo " [doxygen]"
@$(DOXYGEN)

# Automatic dependence on included header files.
.PRECIOUS: dep/%.d
dep/%.d: $(SRC)/%.c dep
@echo " > $@" \
&& $(CC) $(CPPFLAGS) -MM -MG $< > $@.$$$$ \
&& sed 's|\w*\.o[ :]*| $(OBJ)/&|g' < $@.$$$$ > $@; \
rm -f $@.$$$$

0 comments on commit 71fa7c4

Please sign in to comment.