cleaning things up a bit
This commit is contained in:
parent
e026dabefb
commit
731e1002cd
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,5 +1 @@
|
|||||||
gowrikumar/00-sizeof
|
gowrikumar/bin
|
||||||
gowrikumar/02-dowhile
|
|
||||||
gowrikumar/03-stdoutbuf
|
|
||||||
gowrikumar/03b-stdoutbuf
|
|
||||||
gowrikumar/03c-stdoutbuf
|
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
# puzzles from http://www.gowrikumar.com/c/
|
BINDIR := ./bin
|
||||||
|
|
||||||
|
export BINDIR
|
||||||
|
|
||||||
|
|
||||||
all: $(patsubst %.c,%,$(wildcard *.c))
|
all:
|
||||||
|
cd src && $(MAKE)
|
||||||
|
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
|
0
gowrikumar/bin/.keep
Normal file
0
gowrikumar/bin/.keep
Normal file
19
gowrikumar/src/04-macrodef.c
Normal file
19
gowrikumar/src/04-macrodef.c
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/**
|
||||||
|
* :author: Dan Buch (daniel.buch@gmail.com)
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#define f(a, b) a##b
|
||||||
|
#define g(a) #a
|
||||||
|
#define h(a) g(a)
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
printf("%s\n", h(f(1, 2)));
|
||||||
|
printf("%s\n", g(f(1, 2)));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* vim:filetype=c:fileencoding=utf-8
|
||||||
|
*/
|
14
gowrikumar/src/Makefile
Normal file
14
gowrikumar/src/Makefile
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# puzzles from http://www.gowrikumar.com/c/
|
||||||
|
|
||||||
|
BINDIR := ../bin
|
||||||
|
|
||||||
|
ALL_BIN := $(patsubst %.c,$(BINDIR)/%,$(wildcard *.c))
|
||||||
|
|
||||||
|
|
||||||
|
$(BINDIR)/%: %.c
|
||||||
|
$(CC) -o $@ $<
|
||||||
|
|
||||||
|
all: $(ALL_BIN)
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: all
|
Loading…
Reference in New Issue
Block a user