Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utils/{gr,hgr}-utils/Makefile: Use pkg-config for compile/link flags #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 19 additions & 18 deletions utils/gr-utils/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include ../../Makefile.inc

CFLAGS = -g -Wall -O2
CFLAGS = -g -Wall -O2 $(shell pkg-config --cflags libpng)
LDFLAGS = $(shell pkg-config --libs libpng)

all: text2gr png2gr png2gr_text png2rle png2lz4 png_to_40x48d png_to_40x96 \
png2sixbitmap png2six80 png2sixrle png2fourrle png2sixrle2 png_16x16 \
Expand All @@ -24,15 +25,15 @@ text2gr.o: text2gr.c
###

png2gr: png2gr.o loadpng.o
$(CC) $(LFLAGS) -o png2gr png2gr.o loadpng.o -lpng
$(CC) $(LFLAGS) -o png2gr png2gr.o loadpng.o $(LDFLAGS) -lpng

png2gr.o: png2gr.c loadpng.h
$(CC) $(CFLAGS) -c png2gr.c

###

png2dgr: png2dgr.o loadpng.o
$(CC) $(LFLAGS) -o png2dgr png2dgr.o loadpng.o -lpng
$(CC) $(LFLAGS) -o png2dgr png2dgr.o loadpng.o $(LDFLAGS) -lpng

png2dgr.o: png2dgr.c loadpng.h
$(CC) $(CFLAGS) -c png2dgr.c
Expand All @@ -41,7 +42,7 @@ png2dgr.o: png2dgr.c loadpng.h
###

png2sprites: png2sprites.o loadpng.o
$(CC) $(LFLAGS) -o png2sprites png2sprites.o loadpng.o -lpng
$(CC) $(LFLAGS) -o png2sprites png2sprites.o loadpng.o $(LDFLAGS) -lpng

png2sprites.o: png2sprites.c loadpng.h
$(CC) $(CFLAGS) -c png2sprites.c
Expand All @@ -50,47 +51,47 @@ png2sprites.o: png2sprites.c loadpng.h
###

png2gr_text: png2gr_text.o loadpng.o
$(CC) $(LFLAGS) -o png2gr_text png2gr_text.o loadpng.o -lpng
$(CC) $(LFLAGS) -o png2gr_text png2gr_text.o loadpng.o $(LDFLAGS) -lpng

png2gr_text.o: png2gr_text.c loadpng.h
$(CC) $(CFLAGS) -c png2gr_text.c

###

png2sixbitmap: png2sixbitmap.o loadpng.o
$(CC) $(LFLAGS) -o png2sixbitmap png2sixbitmap.o loadpng.o -lpng
$(CC) $(LFLAGS) -o png2sixbitmap png2sixbitmap.o loadpng.o $(LDFLAGS) -lpng

png2sixbitmap.o: png2sixbitmap.c loadpng.h
$(CC) $(CFLAGS) -c png2sixbitmap.c

###

png_16x16: png_16x16.o loadpng.o
$(CC) $(LFLAGS) -o png_16x16 png_16x16.o loadpng.o -lpng
$(CC) $(LFLAGS) -o png_16x16 png_16x16.o loadpng.o $(LDFLAGS) -lpng

png_16x16.o: png_16x16.c loadpng.h
$(CC) $(CFLAGS) -c png_16x16.c

###

png2fourrle: png2fourrle.o loadpng.o
$(CC) $(LFLAGS) -o png2fourrle png2fourrle.o loadpng.o -lpng
$(CC) $(LFLAGS) -o png2fourrle png2fourrle.o loadpng.o $(LDFLAGS) -lpng

png2fourrle.o: png2fourrle.c loadpng.h
$(CC) $(CFLAGS) -c png2fourrle.c

###

png2sixrle: png2sixrle.o loadpng.o
$(CC) $(LFLAGS) -o png2sixrle png2sixrle.o loadpng.o -lpng
$(CC) $(LFLAGS) -o png2sixrle png2sixrle.o loadpng.o $(LDFLAGS) -lpng

png2sixrle.o: png2sixrle.c loadpng.h
$(CC) $(CFLAGS) -c png2sixrle.c

###

png2sixrle2: png2sixrle2.o loadpng.o
$(CC) $(LFLAGS) -o png2sixrle2 png2sixrle2.o loadpng.o -lpng
$(CC) $(LFLAGS) -o png2sixrle2 png2sixrle2.o loadpng.o $(LDFLAGS) -lpng

png2sixrle2.o: png2sixrle2.c loadpng.h
$(CC) $(CFLAGS) -c png2sixrle2.c
Expand All @@ -100,7 +101,7 @@ png2sixrle2.o: png2sixrle2.c loadpng.h
###

png2six80: png2six80.o loadpng.o
$(CC) $(LFLAGS) -o png2six80 png2six80.o loadpng.o -lpng
$(CC) $(LFLAGS) -o png2six80 png2six80.o loadpng.o $(LDFLAGS) -lpng

png2six80.o: png2six80.c loadpng.h
$(CC) $(CFLAGS) -c png2six80.c
Expand All @@ -109,15 +110,15 @@ png2six80.o: png2six80.c loadpng.h
###

png2rle: png2rle.o loadpng.o rle_common.o
$(CC) $(LFLAGS) -o png2rle png2rle.o loadpng.o rle_common.o -lpng
$(CC) $(LFLAGS) -o png2rle png2rle.o loadpng.o rle_common.o $(LDFLAGS) -lpng

png2rle.o: png2rle.c loadpng.h rle_common.h
$(CC) $(CFLAGS) -c png2rle.c

###

png2raw: png2raw.o loadpng.o
$(CC) $(LFLAGS) -o png2raw png2raw.o loadpng.o -lpng
$(CC) $(LFLAGS) -o png2raw png2raw.o loadpng.o $(LDFLAGS) -lpng

png2raw.o: png2raw.c loadpng.h
$(CC) $(CFLAGS) -c png2raw.c
Expand All @@ -127,7 +128,7 @@ png2raw.o: png2raw.c loadpng.h
###

png2lz4: png2lz4.o loadpng.o
$(CC) $(LFLAGS) -o png2lz4 png2lz4.o loadpng.o -llz4 -lpng
$(CC) $(LFLAGS) -o png2lz4 png2lz4.o loadpng.o -llz4 $(LDFLAGS) -lpng

png2lz4.o: png2lz4.c loadpng.h
$(CC) $(CFLAGS) -c png2lz4.c
Expand All @@ -137,31 +138,31 @@ png2lz4.o: png2lz4.c loadpng.h
###

png_to_40x48d: png_to_40x48d.o rle_common.o
$(CC) $(LFLAGS) -o png_to_40x48d png_to_40x48d.o rle_common.o -lpng
$(CC) $(LFLAGS) -o png_to_40x48d png_to_40x48d.o rle_common.o $(LDFLAGS) -lpng

png_to_40x48d.o: png_to_40x48d.c rle_common.h
$(CC) $(CFLAGS) -c png_to_40x48d.c

###

png_to_40x96: png_to_40x96.o loadpng.o rle_common.o
$(CC) $(LFLAGS) -o png_to_40x96 png_to_40x96.o loadpng.o rle_common.o -lpng
$(CC) $(LFLAGS) -o png_to_40x96 png_to_40x96.o loadpng.o rle_common.o $(LDFLAGS) -lpng

png_to_40x96.o: png_to_40x96.c loadpng.h rle_common.h
$(CC) $(CFLAGS) -c png_to_40x96.c

###

gr2png: gr2png.o
$(CC) $(LFLAGS) -o gr2png gr2png.o -lpng
$(CC) $(LFLAGS) -o gr2png gr2png.o $(LDFLAGS) -lpng

gr2png.o: gr2png.c
$(CC) $(CFLAGS) -c gr2png.c

###

dgr2png: dgr2png.o
$(CC) $(LFLAGS) -o dgr2png dgr2png.o -lpng
$(CC) $(LFLAGS) -o dgr2png dgr2png.o $(LDFLAGS) -lpng

dgr2png.o: dgr2png.c
$(CC) $(CFLAGS) -c dgr2png.c
Expand Down
11 changes: 6 additions & 5 deletions utils/hgr-utils/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include ../../Makefile.inc

CFLAGS = -O2 -Wall -g
CFLAGS = -g -Wall -O2 $(shell pkg-config --cflags libpng)
LDFLAGS = $(shell pkg-config --libs libpng)

all: pcx2hgr png2hgr png2dhgr shape_table dump_table hgr2png hgr_make_sprite

Expand All @@ -25,15 +26,15 @@ pcx2hgr.o: pcx2hgr.c
###

png2hgr: png2hgr.o
$(CC) -o png2hgr png2hgr.o $(LFLAGS) -lpng
$(CC) -o png2hgr png2hgr.o $(LFLAGS) $(LDFLAGS) -lpng

png2hgr.o: png2hgr.c
$(CC) $(CFLAGS) -c png2hgr.c

###

hgr_make_sprite: hgr_make_sprite.o
$(CC) -o hgr_make_sprite hgr_make_sprite.o $(LFLAGS) -lpng
$(CC) -o hgr_make_sprite hgr_make_sprite.o $(LFLAGS) $(LDFLAGS) -lpng

hgr_make_sprite.o: hgr_make_sprite.c
$(CC) $(CFLAGS) -c hgr_make_sprite.c
Expand All @@ -42,15 +43,15 @@ hgr_make_sprite.o: hgr_make_sprite.c
###

hgr2png: hgr2png.o
$(CC) -o hgr2png hgr2png.o $(LFLAGS) -lpng
$(CC) -o hgr2png hgr2png.o $(LFLAGS) $(LDFLAGS) -lpng

hgr2png.o: hgr2png.c
$(CC) $(CFLAGS) -c hgr2png.c

###

png2dhgr: png2dhgr.o
$(CC) -o png2dhgr png2dhgr.o $(LFLAGS) -lpng
$(CC) -o png2dhgr png2dhgr.o $(LFLAGS) $(LDFLAGS) -lpng

png2dhgr.o: png2dhgr.c
$(CC) $(CFLAGS) -c png2dhgr.c
Expand Down