2017-03-11 17:00:23 +00:00
|
|
|
#
|
|
|
|
# Makefile for crap-libs
|
|
|
|
#
|
|
|
|
# Author: overflowerror
|
|
|
|
#
|
|
|
|
|
|
|
|
CC = gcc
|
|
|
|
DEFS = -D_XOPEN_SOURCE=500 -D_BSD_SOURCE
|
|
|
|
CFLAGS = -Wall -Wextra -g -std=c99 -DENDEBUG $(DEFS) -fPIC
|
|
|
|
LDFLAGS = $(DEFS) -rdynamic
|
|
|
|
LIBFLAGS = -shared $(DEFS)
|
|
|
|
|
|
|
|
.PHONY: all clean
|
|
|
|
|
2017-03-12 00:18:08 +00:00
|
|
|
all: example libcrap.so
|
2017-03-11 17:00:23 +00:00
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
2017-04-14 22:13:28 +00:00
|
|
|
example: example.o memory.o try.o oop.o exceptions/stdex.o tools/strbuilder.o lists/lists.o lists/arraylist.o lists/linkedlist.o
|
2017-03-11 17:00:23 +00:00
|
|
|
$(CC) $(LDFLAGS) -o $@ $^
|
|
|
|
|
2017-04-14 22:13:28 +00:00
|
|
|
libcrap.so: memory.o try.o oop.o exceptions/stdex.o tools/strbuilder.o lists/lists.o lists/arraylist.o lists/linkedlist.o
|
2017-03-11 17:00:23 +00:00
|
|
|
$(CC) $(LIBFLAGS) -o $@ $^
|
|
|
|
|
2017-04-14 22:13:28 +00:00
|
|
|
example.o: example.c try.h crap.h
|
2017-03-11 17:00:23 +00:00
|
|
|
memory.o: memory.c memory.h oop.h exceptions/stdex.h
|
|
|
|
try.o: try.c try.h oop.h exceptions/stdex.h
|
|
|
|
oop.o: oop.h misc.h
|
2017-03-12 00:18:08 +00:00
|
|
|
|
2017-03-11 17:00:23 +00:00
|
|
|
exceptions/stdex.o: exceptions/stdex.c exceptions/stdex.h
|
|
|
|
|
2017-03-12 00:18:08 +00:00
|
|
|
tools/strbuilder.o: tools/strbuilder.c tools/strbuilder.h exceptions/stdex.h
|
|
|
|
|
|
|
|
lists/lists.o: lists/lists.c lists/lists.h oop.h
|
|
|
|
lists/arraylist.o: lists/arraylist.c lists/arraylist.h oop.h
|
2017-04-14 22:13:28 +00:00
|
|
|
lists/linkedlist.o: lists/linkedlist.c lists/linkedlist.h oop.h
|
2017-03-12 00:18:08 +00:00
|
|
|
|
2017-03-11 17:00:23 +00:00
|
|
|
clean:
|
2017-03-12 00:18:08 +00:00
|
|
|
rm -f *.o exceptions/*.o tools/*.o lists/*.o example
|