Skip to content

Instantly share code, notes, and snippets.

@garrettr
Created June 12, 2012 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garrettr/2919669 to your computer and use it in GitHub Desktop.
Save garrettr/2919669 to your computer and use it in GitHub Desktop.
Universal Makefile for Statmap
CC=clang
CFLAGS=-O3 -msse2 -Wall -Wextra -D_FILE_OFFSET_BITS=64
objects := $(patsubst %.c,%.o,$(wildcard *.c))
all: statmap statmap.so
statmap: $(objects)
$(CC) -o statmap \
$(objects) \
$(CFLAGS) \
-lm -lpthread
cp statmap ../bin/
statmap.so : $(objects)
$(CC) $(CFLAGS) \
-fpic -shared -Wl,-soname,libstatmap.so.1 -o libstatmap.so \
$(wildcard *.c)
.PHONY : clean
clean :
-rm $(objects)
-rm statmap
-rm libstatmap.so
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment