Initial Commit
[Projects.git] / dundancy / Makefile
blobb1b59df5f7e75c9be0884c7cd8296b13040e93c5
1 BUILD := build
2 COMPILER := gcc
3 OPTIONS := -g
4 SOURCES := source
5 CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
6 HFILES := source/dundancy.h
7 OFILES := $(CFILES:.c=.o)
8 LIB := $(OFILES)
9 LIBDIR := /usr/lib
10 INCLUDEDIR := /usr/include
12 all: install
14 $(BUILD):
15 @mkdir -p $@
17 %.o: %.c
18 @echo $(notdir $<)
19 @$(COMPILER) $(OPTIONS) -c $< -o $@
21 %.so: %.c
22 @echo $(notdir $<)
23 @$(COMPILER) -shared $(OPTIONS) -o $< $(SOURCE) -lc
25 %.a: %.c
26 @echo $(notdir $<)
27 @$(AR) r $@ $<
29 install: $(HFILES) $(OFILES)
30 @echo Installing...
31 @cp $(HFILES) $(INCLUDEDIR)
32 @cp $(OFILES) $(LIBDIR)
34 clean: $(OFILES)
35 @rm -fr $<