From f7ad6580ee90bd394ea5de53c8baa9979a688409 Mon Sep 17 00:00:00 2001 From: Alex Denes Date: Fri, 8 Dec 2023 19:58:57 +0000 Subject: [PATCH] Argument order matters --- c/Makefile | 4 ++-- cxx/Makefile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/c/Makefile b/c/Makefile index 5076965..8eaf384 100644 --- a/c/Makefile +++ b/c/Makefile @@ -5,13 +5,13 @@ OBJ := $(SRC:.c=.o) all: $(OBJ) $(OUT) %.o: %.c - $(CC) -o $@ -c $(CFLAGS) $< + $(CC) $< -c $(CFLAGS) -o "$@" clean: rm -f $(OBJ) $(OUT) ifneq ($(OUT),) $(OUT): $(OBJ) - $(CC) -o "$@" $(LDFLAGS) $^ + $(CC) $^ $(LDFLAGS) -o "$@" endif .PHONY: all clean diff --git a/cxx/Makefile b/cxx/Makefile index 2fed3d1..c222162 100644 --- a/cxx/Makefile +++ b/cxx/Makefile @@ -5,14 +5,14 @@ OBJ = ${SRC:.cpp=.o} all: ${OBJ} ${OUT} %.o: %.cpp - ${CXX} -o $@ -c ${CXXFLAGS} $< + ${CXX} $< -c ${CXXFLAGS} -o "$@" clean: rm -f ${OBJ} ${OUT} ifneq (${OUT},) ${OUT}: ${OBJ} - ${CXX} -o "$@" ${LDFLAGS} $^ + ${CXX} $^ ${LDFLAGS} -o "$@" endif .PHONY: all clean