I want to create a makefile that supports posix semaphores. That is what I've got so far:
CFLAGS=-g -ansi -pedantic -Wall -Werror -D_XOPEN_SOURCE=600
LDFLAGS=-pthread
CC=gcc
OBJECTS=MsgQueueMain.o MsgQueue.o Queue.o MyMalloc.o
TARGET=MsgQueueMain
all: $(TARGET)
$(TARGET): $(OBJECTS)
$(CC) $(OBJECTS) -o $@
include depends
depends:
$(CC) -MM $(OBJECTS:.o=.c) > depends
clean:
rm ./$(TARGET) *.o
For some reason, I'm getting "undefined reference" for all calls to semaphore.h api functions.