# # Makefile - maintained by author - date # APPL = prog # # Outils # SHELL = /bin/sh PRINTER = dominique COMPRESS = gzip # # Paramètres de compilation et d'édition de liens # CC = gcc LD = $(CC) CFLAGS = -c -g LDFLAGS = -g # # #define eventuels forces ici # DEFS = # # Paramètres d'installation # prefix = /usr/local BINDIR = $(prefix)/bin MANDIR = $(prefix)/man MANEXT = 1 # # Librairies # # Solaris LIBS = -lsocket -lnsl # Linux #LIBS = # # Executables de l'application # EXEC = $(APPL) # # Objets de l'application # OBJS = mod1.o mod2.o mod3.o # # Sources de l'application # SRCS = mod1.c mod2.c mod3.c INCL = inc1.h inc2.h MANS = $(APPL).$(MANEXT) SOURCES = README COPYRIGHT INSTALL Makefile $(SRCS) $(INCL) $(MANS) # # Règle d'inférence, construction des .o a partir des .c # .DEFAULT:; @echo "$< n'existe pas" .c.o: $(CC) $(DEFS) $(CFLAGS) $< # # Cibles et leurs actions # all: ${EXEC) $(APPL): $(OBJS) $(LD) $(LDFLAGS) $(OBJS) $(LIBS) -o $@ clean: -@rm $(OBJS) $(EXEC) core 1>/dev/null 2>&1 install: install -m 755 -o root -g staff $(EXEC) $(BINDIR) install_man: install -m 644 $(APPL).$(MANEXT) $(MANDIR)/man$(MANEXT) print: $(SRCS) $(INCL) -@$(PRINTER) $? -@touch $@ printall: -@$(PRINTER) $(SOURCES) tar: tar cvf $(APPL).tar $(SOURCES) archive: tar $(COMPRESS) $(APPL).tar