Commit a0009e2f authored by Yoann Pigné's avatar Yoann Pigné

Makefile that should work will linux.

parent cf2812ca
...@@ -3,6 +3,14 @@ OBJDIR=obj ...@@ -3,6 +3,14 @@ OBJDIR=obj
SRCDIR=src SRCDIR=src
INCDIR=include INCDIR=include
ifeq ($(shell uname),Darwin)
AR=libtool
ARFLAGS=-static -o
else
AR=ar
ARFLAGS=rcs
endif
CC = g++ CC = g++
CWARN = -W -Wall -Wshadow -Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized -O CWARN = -W -Wall -Wshadow -Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized -O
...@@ -27,25 +35,25 @@ OBJS = \ ...@@ -27,25 +35,25 @@ OBJS = \
.SECONDARY: .SECONDARY:
#-- Rules #-- Rules
all : $(OUT_BINARY) $(OUT_LIBRARY) all: $(OUT_BINARY) $(OUT_LIBRARY)
$(OUT_BINARY) : $(OBJS) $(OUT_BINARY): $(OBJS)
$(CC) $(CFLAGS) $(OBJS) -o $(OUT_BINARY) $(CC) $(CFLAGS) $(OBJS) -o $(OUT_BINARY)
$(OUT_LIBRARY) : $(OBJS) $(OUT_LIBRARY): $(OBJS)
libtool -static -o $(OUT_LIBRARY) $(OBJS) $(AR) $(ARFLAGS) $(OUT_LIBRARY) $(OBJS)
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp $(OBJDIR)/%.o: $(SRCDIR)/%.cpp
mkdir -p $(OBJDIR) mkdir -p $(OBJDIR)
$(CC) $(CFLAGS) -c $? -o $@ $(CC) $(CFLAGS) -c $? -o $@
.PHONY : clean depend fresh .PHONY: clean depend fresh
tag : tag:
find src/*.cpp include/*.h > filelist find src/*.cpp include/*.h > filelist
$(CTAG) -L $(CTAGFILE) $(CTAG) -L $(CTAGFILE)
clean : clean:
-rm -f $(OBJDIR)/*.o $(PARSE_C) $(PARSE_H) -rm -f $(OBJDIR)/*.o $(PARSE_C) $(PARSE_H)
-rm -f $(OBJDIR)/*/*.o $(PARSE_C) $(PARSE_H) -rm -f $(OBJDIR)/*/*.o $(PARSE_C) $(PARSE_H)
-rm -f $(SRCDIR)/*.output $(LEX_C) -rm -f $(SRCDIR)/*.output $(LEX_C)
...@@ -54,4 +62,4 @@ clean : ...@@ -54,4 +62,4 @@ clean :
-rm -f $(OUT_BINARY) -rm -f $(OUT_BINARY)
-rm -f $(OUT_LIBRARY) -rm -f $(OUT_LIBRARY)
fresh : clean all fresh: clean all
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment