summaryrefslogblamecommitdiffstats
blob: aead94897fd9bc14faf80de253b2689be85cbbb5 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                         

                   









                                          
                                        

 

# 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 $@ $<