Makefile
By: a guest | Mar 22nd, 2010 | Syntax:
Make | Size: 1.31 KB | Hits: 62 | Expires: Never
# amqp-fidius
# status: nicht so optimal
# kompiliert die rabbitmq-c lib source und unsere eigenen Funktionen und Beispiele.
# example_utils.c und example_utils.h haben wir nicht geschrieben.
# default setup
CC=gcc
CCFLAGS=-Wall -std=c99
LDFLAGS=-lpthread
SRC=example_utils.c
OBJ=$(SRC:.c=.o)
# setup static library compiling
ARFLAGS=rc
RABBITLIB_SRC=$(shell find ../rabbitmq-c/librabbitmq/ -name "*.c")
RABBITLIB_OBJ=$(RABBITLIB_SRC:.c=.o)
LIBCCFLAGS=-L. -lrabbitmq
.PHONY: clean clean-lib clean-all
#all: librabbitmq example
client.o: client.c client.h
$(CC) $(CCFLAGS) -c $<
example.o: example.c
$(CC) $(CCFLAGS) -c $<
example: example.o client.o
$(CC) $(CCFLAGS) example.o client.o -o example
#example: example.c $(OBJ)
# $(CC) $(CCFLAGS) $(LIBCCFLAGS) example.c $(SRC) -o example
## create static library
#librabbitmq: $(RABBITLIB_OBJ)
# $(CC) -c $(CCFLAGS) $(RABBITLIB_SRC)
# ar $(ARFLAGS) librabbitmq.a $(RABBITLIB_OBJ)
# ranlib librabbitmq.a
## this may need more attention. a pattern like "%.o: %.c\n\t..." may be useful
#t_send_file: $(OBJ) t_send_file.c
# $(CC) $(OBJ) t_send_file.c -o t_send_file
#t_get_file: $(OBJ) t_get_file.c
# $(CC) $(OBJ) t_get_file.c -o t_get_file
#clean:
# rm -f *.o *~
#clean-lib:
# rm -f librabbitmq.a
#clean-all: clean clean-lib