Skip to content

Commit

Permalink
Tweak Makefile
Browse files Browse the repository at this point in the history
* Use well-known variable names
* Respect values set in environment

Obtained from FreeBSD ports collection
  • Loading branch information
AMDmi3 committed Jun 22, 2014
1 parent 0ba818e commit 86f78a6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
GCC=gcc
CCFLAGS=-Wall -pedantic -std=c99 -D_BSD_SOURCE
LDFLAGS=-lImlib2
CC?=gcc
CFLAGS+=-Wall -pedantic -std=c99 -D_BSD_SOURCE
LDFLAGS+=-lImlib2
PROG=icat
MODS=icat.o

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

ifeq ($(uname_S),Darwin)
CCFLAGS:=$(CCFLAGS) -I/opt/X11/include
CFLAGS:=$(CFLAGS) -I/opt/X11/include
endif

all: $(PROG)

%.o: %.c
$(GCC) -c $(CCFLAGS) -o $@ $<
$(CC) -c $(CFLAGS) -o $@ $<

$(PROG): $(MODS)
$(GCC) -o $@ $< $(LDFLAGS)
$(CC) -o $@ $< $(LDFLAGS)

clean:
-rm -f $(PROG) $(MODS)
Expand Down

0 comments on commit 86f78a6

Please sign in to comment.