Paste: Makefile

Author: optimizer
Mode: factor
Date: Tue, 27 Oct 2009 23:42:41
Plain Text |
CXXFLAGS=-I/usr/local/include/  -g -Wall
LDFLAGS=-L/usr/local/lib -lglfw -lGLU -lGL

SRCS := $(shell find -name "*.cpp")
OBJS := $(patsubst %.cpp, %.o, $(filter %.cpp, $(SRCS)))


prog: $(OBJS)
  $(CXX) $(CXXFLAGS) $^ -o $@

include Makefile.depend

depend: Makefile.depend

Makefile.depend: $(SRCS)
  g++ -MM $(SRCS) > Makefile.depend

clean:
  rm -f *.o prog

.PHONY: clean
~                  

Annotation: alo

Author: alo
Mode: makefile
Date: Fri, 4 Dec 2009 23:12:01
Plain Text |
CC = gcc
CFLAGS = -ansi -pedantic -Wall
LDFLAGS =
EXEC = mastermind
SRC = $(wildcard *.c)
OBJ = $(SRC:.c=.o)
TGZDIR = MasterMind

all: $(EXEC) clean

# Suppression des fichiers inutiles
clean:
	@rm -rf *.out # Executables temporaires
	@rm -rf *.o # Fichiers objets
	@rm -rf *~ # Fichiers backup
	@rm -rf cscope.out # Sortie de cscope

# Suppression des fichiers inutiles ET de l'exécutable
cleaner: clean
	@rm -rf $(EXEC)

# Création de l'archive contenant les sources
dist: cleaner
	@mkdir $(TGZDIR)
	@cp *.c $(TGZDIR)
	@cp *.h $(TGZDIR)
	@cp Makefile $(TGZDIR)
	@cp Projet.pdf $(TGZDIR)
	tar -cvzf $(TGZDIR).tar.gz $(TGZDIR)
	@rm -rvf $(TGZDIR)

# Cible particulière
.PHONY: clean cleaner dist

mastermind: $(OBJ)
	@$(CC) -o $(@) $^ $(LDFLAGS)

main.o: Mastermind.h Reponse.h Sequence.h Tab4.h Tab6.h
Mastermind.o: Mastermind.h Reponse.h Sequence.h Tab4.h Tab6.h
Reponse.o: Reponse.h
Sequence.o: Sequence.h
Tab4.o: Tab4.h
Tab6.o: Tab6.h

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

New Annotation

Summary:
Author:
Mode:
Body: