help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

make more targets


From: peter kotvan
Subject: make more targets
Date: Sat, 6 Nov 2010 09:56:45 +0100

Hi,

i have to compile few simple programs for demonstrating socket
communication. I can make them all with one makefile using wildcards
but they share prerequisities and they would all be linked with same
libraries. It is posibble to make more targets with different
prerequisites and libraries for each of them? My makefile looks like
this now:

CC=gcc -Wall -g

SRC_DIR=.
EXE_DIR=../bin

EXES = \
        ${EXE_DIR}/1client \
        ${EXE_DIR}/2client \
        ${EXE_DIR}/server \

%.o: ${SRC_DIR}/%.c client.h server.h
        ${CC} -o $@ -c $<

${EXE_DIR}/%: %.o
        ${CC} -o $@ $<

all:    ${EXES}

clean:
        rm -f *.o


Thanks in advance

Peter



reply via email to

[Prev in Thread] Current Thread [Next in Thread]