Add basic makefiles.
This commit is contained in:
parent
b5367ea57e
commit
31c10caf80
33
c/Makefile
Normal file
33
c/Makefile
Normal file
@ -0,0 +1,33 @@
|
||||
#SOURCE= vlc
|
||||
#CFLAGS=$(shell pkg-config --libs vlc)
|
||||
#
|
||||
#all: compilationvlc
|
||||
#
|
||||
#compilationvlc:
|
||||
# $(CC) $(SOURCE).c -o $(SOURCE) $(CFLAGS)
|
||||
|
||||
CC=clang
|
||||
CFLAGS=-c -Wall -g
|
||||
LDFLAGS=
|
||||
CFILES=$(wildcard *.c) # CFILES => recompiles everything on a C file change
|
||||
EXEC=$(basename $(wildcard *.c))
|
||||
#SOURCES=$(wildcard *.c)
|
||||
TESTS=$(addsuffix .test, $(EXEC))
|
||||
|
||||
all: $(SOURCES) $(EXEC)
|
||||
|
||||
$(EXEC): $(CFILES)
|
||||
$(CC) $(LDFLAGS) $@.c -o $@
|
||||
|
||||
.c.o:
|
||||
$(CC) $(CFLAGS) $< -o $@
|
||||
|
||||
clean:
|
||||
@-rm $(EXEC)
|
||||
|
||||
# to test a binary "prog" : make prog.test
|
||||
|
||||
$(TESTS):
|
||||
valgrind --leak-check=full -v --track-origins=yes ./$(basename $@)
|
||||
|
||||
test: all $(TESTS)
|
4
c/Makefile.distort
Normal file
4
c/Makefile.distort
Normal file
@ -0,0 +1,4 @@
|
||||
all: compilation
|
||||
|
||||
compilation:
|
||||
clang -o distortion $$(pkg-config --libs --cflags sndfile) -lm distort.c
|
Loading…
Reference in New Issue
Block a user