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

_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to