1234567891011121314151617181920212223242526272829303132333435 |
- CC=gcc
- CFLAGS=-Wall -O3
- CLFAGS-DBG=$(CFLAGS) -g
- LDFLAGS=-lm
- LDFLAGS-DBG=$(LDFLAGS) -g
- LDFLAGS+= -s
-
- all: sadrand
-
- sadrand: sadrand.o
- $(CC) -o $@ $< $(LDFLAGS)
-
- sadrand.o: sadrand.c
- $(CC) $(CFLAGS) -c -o $@ $<
-
- sadrand-dbg: sadrand-dbg.o
- $(CC) -o $@ $< $(LDFLAGS-DBG)
-
- sadrand-dbg.o: sadrand.c
- $(CC) $(CFLAGS-DBG) -c -o $@ $<
-
- pkg: sadrand.tar.gz
- sadrand.tar.gz: TMP=$(shell mktemp)
- sadrand.tar.gz: dist .distfile sadrand.c Makefile
- tar -C .. \
- -acvf '$(TMP)' $(shell cat .distfile | sed "s#^#$(shell basename `pwd`)/#" )
- mv -v '$(TMP)' '$@'
-
- .PHONY: clean dist
-
- clean:
- -rm *.o
-
- dist: clean
- -rm sadrand sadrand-dbg sadrand.tar.gz
|