summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile13
-rw-r--r--config.mk4
2 files changed, 10 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index baf2d41..27dc544 100644
--- a/Makefile
+++ b/Makefile
@@ -11,10 +11,10 @@ SCR = 2ff
MAN1 = 2ff.1 $(BIN:=.1)
MAN5 = farbfeld.5
-png2ff-LDFLAGS = $(PNG-LDFLAGS)
-ff2png-LDFLAGS = $(PNG-LDFLAGS)
-jpg2ff-LDFLAGS = $(JPG-LDFLAGS)
-ff2jpg-LDFLAGS = $(JPG-LDFLAGS)
+png2ff-LDLIBS = $(PNG-LDLIBS)
+ff2png-LDLIBS = $(PNG-LDLIBS)
+jpg2ff-LDLIBS = $(JPG-LDLIBS)
+ff2jpg-LDLIBS = $(JPG-LDLIBS)
all: $(BIN)
@@ -23,7 +23,10 @@ $(BIN): $(REQ:=.o)
$(BIN:=.o): config.mk $(HDR) $(REQ:=.h)
.o:
- $(CC) -o $@ $< $(REQ:=.o) $($*-LDFLAGS) $(LDFLAGS)
+ $(CC) -o $@ $(LDFLAGS) $< $(REQ:=.o) $($*-LDLIBS)
+
+.c.o:
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
clean:
rm -f $(BIN) $(BIN:=.o) $(REQ:=.o)
diff --git a/config.mk b/config.mk
index 194ab86..67d5448 100644
--- a/config.mk
+++ b/config.mk
@@ -11,8 +11,8 @@ MANPREFIX = ${PREFIX}/man
CPPFLAGS = -D_DEFAULT_SOURCE
CFLAGS = -std=c99 -pedantic -Wall -Wextra -Os
LDFLAGS = -s
-PNG-LDFLAGS = -lpng
-JPG-LDFLAGS = -ljpeg
+PNG-LDLIBS = -lpng
+JPG-LDLIBS = -ljpeg
# compiler and linker
CC = cc