X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=TP_8%2Fexo1%2FMakefile;fp=TP_8%2Fexo1%2FMakefile;h=b24c120ef45613c5934f04453e1346e06ca1680e;hb=e1b5a0c2efdaae55cb7ccb02126766c41b33afa4;hp=0000000000000000000000000000000000000000;hpb=b10f2dc98106b52e190abb4041be21880b2a391c;p=TD_C.git diff --git a/TP_8/exo1/Makefile b/TP_8/exo1/Makefile new file mode 100644 index 0000000..b24c120 --- /dev/null +++ b/TP_8/exo1/Makefile @@ -0,0 +1,31 @@ +TARGET = exo1 +LIBS = +CC = gcc +# Enforce C11 ISO standard for now +CFLAGS = -std=c11 -g -Wall +LDFLAGS = -g -Wall + +.PHONY: default all clean + +default: $(TARGET) +all: default + +OBJECTS = $(patsubst %.c, %.o, $(wildcard *.c)) +HEADERS = $(wildcard *.h) + +%.o: %.c $(HEADERS) + $(CC) $(CFLAGS) -c $< -o $@ + +.PRECIOUS: $(TARGET) $(OBJECTS) + +$(TARGET): $(OBJECTS) + $(CC) $(OBJECTS) $(LDFLAGS) $(LIBS) -o $@ + +clean: + -rm -f $(TARGET) $(OBJECTS) + +disassemble: $(TARGET) + objdump -d $< | less + +symbols: $(TARGET) + objdump -t $< | sort | less