Argument order matters

This commit is contained in:
Alex D. 2023-12-08 19:58:57 +00:00
parent ebea2b2a0d
commit f7ad6580ee
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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