Makefile 768 Bytes
Newer Older
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 31 32 33 34 35 36 37
CC		= gcc
CFLAGS		= -Wall -ansi -c -O3
INCLUDES	= -I./include
LD		= gcc
LDFLAGS		=
LIBS		=

SRCS	= $(wildcard src/*.c)
OBJS	= $(patsubst %.c,%.o,$(SRCS))
EXECS	= ta des_ta
BINDIR	= /datas/teaching/courses/HWSec/labs/bin

.PHONY: help all clean ultraclean

help:
	@echo "Type:"
	@echo "<make> or <make help> to get this help message"
	@echo "<make all> to generate the 'ta' and 'des_ta' executable"
	@echo "<make clean> to clean a bit"
	@echo "<make ultraclean> to really clean"

all: $(EXECS)

ta: ta.o p.o $(OBJS)
	$(LD) $(LDFLAGS) $^ -o $@ $(LIBS) -lm

des_ta: des_ta.o p.o $(OBJS)
	$(LD) $(LDFLAGS) $^ -o $@ $(LIBS) -lm

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

clean:
	rm -f $(OBJS) des_ta.o p.o ta.o

ultraclean:
	rm -f $(OBJS) $(EXECS) des_ta.o ta.o ta.o