crap-libs/try/Makefile

36 lines
740 B
Makefile
Raw Normal View History

2017-03-09 15:24:52 +00:00
#
# Makefile for crap-libs/try
#
# Author: overflowerror
#
CC = gcc
2017-03-10 17:43:56 +00:00
DEFS = -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -B "../oop/"
CFLAGS = -Wall -Wextra -g -std=c99 -DENDEBUG $(DEFS) -fPIC
2017-03-10 17:43:56 +00:00
LDFLAGS = $(DEFS) -rdynamic
2017-03-09 15:24:52 +00:00
LIBFLAGS = -shared $(DEFS)
.PHONY: all clean
all: example libtry.so
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
2017-03-10 17:43:56 +00:00
example: example.o try.o exceptions/exceptions.o ../oop/liboop.so
2017-03-09 15:24:52 +00:00
$(CC) $(LDFLAGS) -o $@ $^
2017-03-10 17:43:56 +00:00
libtry.so: try.o exceptions/exceptions.o ../oop/liboop.so
2017-03-09 15:24:52 +00:00
$(CC) $(LIBFLAGS) -o $@ $^
try.o: try.c try.h
example.o: example.c try.h
2017-03-10 17:43:56 +00:00
exceptions/exceptions.o: exceptions/exceptions.c exceptions/exceptions.h
../oop/liboop.so:
cd ../oop/ && $(MAKE) liboop.so
2017-03-09 15:24:52 +00:00
clean:
rm -f *.o example libtry.so
2017-03-10 17:43:56 +00:00
cd ../oop/ && $(MAKE) clean