summaryrefslogtreecommitdiffstats
blob: aead94897fd9bc14faf80de253b2689be85cbbb5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

# get the type of OS currently running
OS=$(shell uname)

# check if the OS string contains 'Linux'
ifneq (,$(findstring Linux, $(OS)))
# Linux OS...
APP_EXT=
CLEAN=rm -f
else
# windows OS...
APP_EXT=.exe
CLEAN=del
endif

CCOVERRIDE ?= $(CC)

SRCS = $(wildcard *.c)
EXES = $(patsubst %.c,%$(APP_EXT),$(SRCS))

.PHONY: all clean
all: $(EXES)

clean:
	$(CLEAN) $(EXES)

%$(APP_EXT): %.c
	$(CCOVERRIDE) $(CFLAGS) -o $@ $<