fixed chicken messages
[snoogans.git] / Makefile
blobd26e061ecefb1b94b0d76c806c54feb1fd3b8b20
1 CC = gcc
3 CFLAGS = -Wall -m32
5 MAKEDEPEND = -MD
7 DEPDIR = .dep
9 SOFLAGS = -fPIC -shared
11 LIBS = -lpthread
13 CSRC := $(wildcard *.c)
15 ASMSRC := $(wildcard *.S)
17 OBJ = $(CSRC:%.c=%.o) $(ASMSRC:%.S=%.o)
19 EXE = snoogans.so
21 INSTALLPATH = /usr/local/lib
23 PROCESSDEP = @mkdir -p $(DEPDIR); \
24 cp $*.d $(DEPDIR)/$*.d; \
25 sed -e 's/\#.*//' -e 's/^[^:]*: *//' -e 's/ * \\$$//' -e '/^$$/ d' -e 's/$$/:/' < $*.d >> $(DEPDIR)/$*.d; \
26 rm -f $*.d;
28 .PHONY: build
29 build: $(OBJ)
30 $(CC) $(CFLAGS) $(SOFLAGS) -o $(EXE) $(OBJ) $(LIBS)
31 @echo
32 @echo "*** BUILD COMPLETE ***"
34 %.o: %.c
35 $(CC) -c $(CFLAGS) $(MAKEDEPEND) -o $@ $<
36 $(PROCESSDEP)
38 %.o: %.S
39 $(CC) -c $(CFLAGS) $(MAKEDEPEND) -o $@ $<
40 $(PROCESSDEP)
42 -include $(CSRC:%.c=$(DEPDIR)/%.d) $(ASMSRC:%.S=$(DEPDIR)/%.d)
44 .PHONY: install
45 install:
46 cp $(EXE) $(INSTALLPATH)
48 .PHONY: remove
49 remove:
50 rm -f $(INSTALLPATH)/$(EXE)
52 .PHONY: clean
53 clean:
54 rm -f $(OBJ) $(EXE); \
55 rm -rf $(DEPDIR);