Skip to content

Commit 86f78a6

Browse files
committed
Tweak Makefile
* Use well-known variable names * Respect values set in environment Obtained from FreeBSD ports collection
1 parent 0ba818e commit 86f78a6

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
GCC=gcc
2-
CCFLAGS=-Wall -pedantic -std=c99 -D_BSD_SOURCE
3-
LDFLAGS=-lImlib2
1+
CC?=gcc
2+
CFLAGS+=-Wall -pedantic -std=c99 -D_BSD_SOURCE
3+
LDFLAGS+=-lImlib2
44
PROG=icat
55
MODS=icat.o
66

77
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo unknown')
88

99
ifeq ($(uname_S),Darwin)
10-
CCFLAGS:=$(CCFLAGS) -I/opt/X11/include
10+
CFLAGS:=$(CFLAGS) -I/opt/X11/include
1111
endif
1212

1313
all: $(PROG)
1414

1515
%.o: %.c
16-
$(GCC) -c $(CCFLAGS) -o $@ $<
16+
$(CC) -c $(CFLAGS) -o $@ $<
1717

1818
$(PROG): $(MODS)
19-
$(GCC) -o $@ $< $(LDFLAGS)
19+
$(CC) -o $@ $< $(LDFLAGS)
2020

2121
clean:
2222
-rm -f $(PROG) $(MODS)

0 commit comments

Comments
 (0)