makefile 628 Bytes
Newer Older
1 2 3 4 5
CC = gcc
CXX = g++
CSRCPATH = $(wildcard src/*.c)
CXXSRCPATH = $(wildcard src/*.cpp)
OBJPATH = $(addprefix build/,$(notdir $(CSRCPATH:.c=.o) $(CXXSRCPATH:.cpp=.o)))
denis's avatar
denis committed
6 7
INCLUDES = -I/usr/include/mysql
LIBS = -L/usr/lib/mysql -lmysqlclient -lm
8 9 10
CFLAGS = -lm -Wall -O2 -L/usr/lib/mysql/ -lmysqlclient -pedantic -Wextra -std=c99
CCFLAGS=-Wall -g -std=c++11
LDFLAGS=-g -Wall -lstdc++
denis's avatar
denis committed
11

12

denis's avatar
denis committed
13 14 15
all:ichinscratchy

ichinscratchy: $(OBJPATH)
16
	$(CC) -g -o $@ $^ $(LIBS) $(LDFLAGS)
denis's avatar
denis committed
17 18

build/%.o: src/%.c
19
	$(CC) $(CFLAGS) -g -c $(INCLUDES) -o $@ $<
20 21 22

build/%.o: src/%.cpp
	$(CXX) $(CCFLAGS) -g -c -o $@ $<
denis's avatar
denis committed
23
	
24
clean:
denis's avatar
denis committed
25 26
	rm -f $(OBJPATH)
	rm -f ichinscratchy