Makefile-ы сгенерированы и чистка сделана автоматом теперича =)

This commit is contained in:
Kolan Sh 2011-07-11 11:48:24 +04:00
parent ab7bf723c1
commit 38573cde7d
52 changed files with 3663 additions and 469 deletions

View File

@ -1,21 +0,0 @@
----- Базовая система -----
linux-image-2.6.20.21
sudo
gdm
---- Администрирование ----
synaptic
------ Рабочий стол -------
gnome-panel
gnome-terminal
nautilus
gnome-volume-manager
--- Средства разработки ---
gcc
make
------ Сборка ядра --------
fakeroot
kernel-package
libncurses5-dev
libc6-dev
---------- Игры -----------
nexuiz

100
c/12309/Makefile Normal file
View File

@ -0,0 +1,100 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=
TARGET0=test12309
TARGET= $(TARGET0)
INCLUDE1=-I$(HOME)/projects/include
INCLUDE2=-I/usr/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
test12309.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
test12309.o: \
test12309.c

111
c/5minLorTest/Makefile Normal file
View File

@ -0,0 +1,111 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=
TARGET0=5min
TARGET1=typical_errors_in_c
TARGET= $(TARGET0) $(TARGET1)
INCLUDE1=-I$(HOME)/projects/include
INCLUDE2=-I/usr/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
5min.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
target_objs1 = \
typical_errors_in_c.o
$(TARGET1): $(target_objs1)
$(CC) $(LDFLAGS) -o $@ $(target_objs1)
5min.o: \
5min.c
typical_errors_in_c.o: \
typical_errors_in_c.c

122
c/LebedevRebusy/Makefile Normal file
View File

@ -0,0 +1,122 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=
TARGET0=koka_kola_voda
TARGET1=koza_koza_stado
TARGET2=magnij_tantal_metally
TARGET= $(TARGET0) $(TARGET1) $(TARGET2)
INCLUDE1=-I$(HOME)/projects/include
INCLUDE2=-I/usr/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
koka_kola_voda.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
target_objs1 = \
koza_koza_stado.o
$(TARGET1): $(target_objs1)
$(CC) $(LDFLAGS) -o $@ $(target_objs1)
target_objs2 = \
magnij_tantal_metally.o
$(TARGET2): $(target_objs2)
$(CC) $(LDFLAGS) -o $@ $(target_objs2)
koka_kola_voda.o: \
koka_kola_voda.c
koza_koza_stado.o: \
koza_koza_stado.c
magnij_tantal_metally.o: \
magnij_tantal_metally.c

166
c/ParallelsTest/Makefile Normal file
View File

@ -0,0 +1,166 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=
TARGET0=1
TARGET1=10
TARGET2=4npipe
TARGET3=4unpipe
TARGET4=6
TARGET5=77
TARGET6=tmp
TARGET= $(TARGET0) $(TARGET1) $(TARGET2) $(TARGET3) $(TARGET4) $(TARGET5) $(TARGET6)
INCLUDE1=-I$(HOME)/projects/include
INCLUDE2=-I/usr/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
1.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
target_objs1 = \
10.o
$(TARGET1): $(target_objs1)
$(CC) $(LDFLAGS) -o $@ $(target_objs1)
target_objs2 = \
4npipe.o
$(TARGET2): $(target_objs2)
$(CC) $(LDFLAGS) -o $@ $(target_objs2)
target_objs3 = \
4unpipe.o
$(TARGET3): $(target_objs3)
$(CC) $(LDFLAGS) -o $@ $(target_objs3)
target_objs4 = \
6.o
$(TARGET4): $(target_objs4)
$(CC) $(LDFLAGS) -o $@ $(target_objs4)
target_objs5 = \
77.o
$(TARGET5): $(target_objs5)
$(CC) $(LDFLAGS) -o $@ $(target_objs5)
target_objs6 = \
tmp.o
$(TARGET6): $(target_objs6)
$(CC) $(LDFLAGS) -o $@ $(target_objs6)
1.o: \
1.c
10.o: \
10.c
4npipe.o: \
4npipe.c
4unpipe.o: \
4unpipe.c
6.o: \
6.c
77.o: \
77.c
tmp.o: \
tmp.c

View File

@ -0,0 +1,133 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=
TARGET0=1
TARGET1=10
TARGET2=4npipe
TARGET3=4unpipe
TARGET= $(TARGET0) $(TARGET1) $(TARGET2) $(TARGET3)
INCLUDE1=-I$(HOME)/projects/include
INCLUDE2=-I/usr/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
1.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
target_objs1 = \
10.o
$(TARGET1): $(target_objs1)
$(CC) $(LDFLAGS) -o $@ $(target_objs1)
target_objs2 = \
4npipe.o
$(TARGET2): $(target_objs2)
$(CC) $(LDFLAGS) -o $@ $(target_objs2)
target_objs3 = \
4unpipe.o
$(TARGET3): $(target_objs3)
$(CC) $(LDFLAGS) -o $@ $(target_objs3)
1.o: \
1.c
10.o: \
10.c
4npipe.o: \
4npipe.c
4unpipe.o: \
4unpipe.c

100
c/ToUpperTest/Makefile Normal file
View File

@ -0,0 +1,100 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=
TARGET0=main
TARGET= $(TARGET0)
INCLUDE1=-I$(HOME)/projects/include
INCLUDE2=-I/usr/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
main.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
main.o: \
main.c

View File

@ -1 +0,0 @@
build.sh

View File

@ -1,9 +0,0 @@
#!/bin/sh
rm -f test test.o
gcc -static -o test main.c
#gcc -c -static test.o main.c && \
#ld -static -o test test.o && \
#rm test.o
./test

111
c/avg_task/Makefile Normal file
View File

@ -0,0 +1,111 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=
TARGET0=avg
TARGET1=avg_arr
TARGET= $(TARGET0) $(TARGET1)
INCLUDE1=-I$(HOME)/projects/include
INCLUDE2=-I/usr/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
avg.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
target_objs1 = \
avg_arr.o
$(TARGET1): $(target_objs1)
$(CC) $(LDFLAGS) -o $@ $(target_objs1)
avg.o: \
avg.c
avg_arr.o: \
avg_arr.c

111
c/bigmalloc/Makefile Normal file
View File

@ -0,0 +1,111 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=-lstdc++
TARGET0=bigmalloc
TARGET1=bignew
TARGET= $(TARGET0) $(TARGET1)
INCLUDE1=-I$(HOME)/projects/include
INCLUDE2=-I/usr/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
bigmalloc.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
target_objs1 = \
bignew.o
$(TARGET1): $(target_objs1)
$(CC) $(LDFLAGS) -o $@ $(target_objs1)
bigmalloc.o: \
bigmalloc.c
bignew.o: \
bignew.cpp

155
c/echo_server-udp/Makefile Normal file
View File

@ -0,0 +1,155 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=
TARGET0=echo-client
TARGET1=echo-server
TARGET2=int2ip
TARGET3=ip2int
TARGET4=sock1
TARGET5=tmp1
TARGET= $(TARGET0) $(TARGET1) $(TARGET2) $(TARGET3) $(TARGET4) $(TARGET5)
INCLUDE1=-I$(HOME)/projects/include
INCLUDE2=-I/usr/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
echo-client.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
target_objs1 = \
echo-server.o
$(TARGET1): $(target_objs1)
$(CC) $(LDFLAGS) -o $@ $(target_objs1)
target_objs2 = \
int2ip.o
$(TARGET2): $(target_objs2)
$(CC) $(LDFLAGS) -o $@ $(target_objs2)
target_objs3 = \
ip2int.o
$(TARGET3): $(target_objs3)
$(CC) $(LDFLAGS) -o $@ $(target_objs3)
target_objs4 = \
sock1.o
$(TARGET4): $(target_objs4)
$(CC) $(LDFLAGS) -o $@ $(target_objs4)
target_objs5 = \
tmp1.o
$(TARGET5): $(target_objs5)
$(CC) $(LDFLAGS) -o $@ $(target_objs5)
echo-client.o: \
echo-client.c
echo-server.o: \
echo-server.c
int2ip.o: \
int2ip.c
ip2int.o: \
ip2int.c
sock1.o: \
sock1.c
tmp1.o: \
tmp1.c

155
c/echo_server/Makefile Normal file
View File

@ -0,0 +1,155 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=
TARGET0=echo-client
TARGET1=echo-server
TARGET2=sock1
TARGET3=tmp1
TARGET4=int2ip
TARGET5=ip2int
TARGET= $(TARGET0) $(TARGET1) $(TARGET2) $(TARGET3) $(TARGET4) $(TARGET5)
INCLUDE1=-I$(HOME)/projects/include
INCLUDE2=-I/usr/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
echo-client.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
target_objs1 = \
echo-server.o
$(TARGET1): $(target_objs1)
$(CC) $(LDFLAGS) -o $@ $(target_objs1)
target_objs2 = \
sock1.o
$(TARGET2): $(target_objs2)
$(CC) $(LDFLAGS) -o $@ $(target_objs2)
target_objs3 = \
tmp1.o
$(TARGET3): $(target_objs3)
$(CC) $(LDFLAGS) -o $@ $(target_objs3)
target_objs4 = \
int2ip.o
$(TARGET4): $(target_objs4)
$(CC) $(LDFLAGS) -o $@ $(target_objs4)
target_objs5 = \
ip2int.o
$(TARGET5): $(target_objs5)
$(CC) $(LDFLAGS) -o $@ $(target_objs5)
echo-client.o: \
echo-client.c
echo-server.o: \
echo-server.c
sock1.o: \
sock1.c
tmp1.o: \
tmp1.c
int2ip.o: \
int2ip.c
ip2int.o: \
ip2int.c

100
c/fcntl_ex/Makefile Normal file
View File

@ -0,0 +1,100 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=
TARGET0=fcntl_lockfile
TARGET= $(TARGET0)
INCLUDE1=-I$(HOME)/projects/include
INCLUDE2=-I/usr/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
fcntl_lockfile.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
fcntl_lockfile.o: \
fcntl_lockfile.c

100
c/flipped_webcam/Makefile Normal file
View File

@ -0,0 +1,100 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=
TARGET0=flipped_webcam
TARGET= $(TARGET0)
INCLUDE1=-I$(HOME)/projects/include
INCLUDE2=-I/usr/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
flipped_webcam.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
flipped_webcam.o: \
flipped_webcam.c

View File

@ -0,0 +1,100 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=
TARGET0=fopen_too_many_files
TARGET= $(TARGET0)
INCLUDE1=-I$(HOME)/projects/include
INCLUDE2=-I/usr/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
fopen_too_many_files.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
fopen_too_many_files.o: \
fopen_too_many_files.c

100
c/fork_ex/Makefile Normal file
View File

@ -0,0 +1,100 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=
TARGET0=fork_address_space
TARGET= $(TARGET0)
INCLUDE1=-I$(HOME)/projects/include
INCLUDE2=-I/usr/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
fork_address_space.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
fork_address_space.o: \
fork_address_space.c

Binary file not shown.

100
c/getc/Makefile Normal file
View File

@ -0,0 +1,100 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=
TARGET0=tmp2
TARGET= $(TARGET0)
INCLUDE1=-I$(HOME)/projects/include
INCLUDE2=-I/usr/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
tmp2.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
tmp2.o: \
tmp2.c

100
c/glcube/Makefile Normal file
View File

@ -0,0 +1,100 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=-lglut
TARGET0=molecule
TARGET= $(TARGET0)
INCLUDE1=-I$(HOME)/projects/include
INCLUDE2=-I/usr/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
molecule.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
molecule.o: \
molecule.c

101
c/gmp-chudnovsky/Makefile Normal file
View File

@ -0,0 +1,101 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=
TARGET0=gmp-chudnovsky
TARGET= $(TARGET0)
INCLUDE1=-I$(HOME)/projects/include
INCLUDE2=-I/usr/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
gmp-chudnovsky.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
gmp-chudnovsky.o: \
gmp-chudnovsky.c \
$(INCLUDE2)/gmp.h

100
c/gprof_ex/Makefile Normal file
View File

@ -0,0 +1,100 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=
TARGET0=collatz
TARGET= $(TARGET0)
INCLUDE1=-I$(HOME)/projects/include
INCLUDE2=-I/usr/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
collatz.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
collatz.o: \
collatz.c

View File

@ -1,16 +1,33 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc CC=cc
CXX=c++ CXX=c++
INCLUDE=-I$(HOME)/projects/include LIBRARIES=-lhash
KOLAN_PROJECTS=$(HOME)/projects TARGET0=libhash_ex
KOLAN_INCLUDE=$(KOLAN_PROJECTS)/include TARGET= $(TARGET0)
INCLUDE1=-I$(HOME)/projects/include
INCLUDE2=-I/usr/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
# Compiler flags #________________________________________
# if mode variable is empty, setting debug build mode # BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),) ifeq ($(mode),)
mode = debug mode = debug
endif endif
ifeq ($(mode),debug) ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=c99 -pedantic -Wextra -Wconversion CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS = LDFLAGS =
endif endif
ifeq ($(mode),profile) ifeq ($(mode),profile)
@ -27,18 +44,16 @@ ifeq ($(mode),release)
endif endif
CFLAGS += -Wall CFLAGS += -Wall
# $(shell pkg-config --cflags libhash) LDFLAGS += -Wall $(LIBRARIES)
LDFLAGS += -Wall -lhash
# $(shell pkg-config --libs libhash)
all: libhash_ex all: change_make_options $(TARGET)
ifneq ($(mode),debug) ifneq ($(mode),debug)
ifneq ($(mode),profile) ifneq ($(mode),profile)
ifneq ($(mode),develop) ifneq ($(mode),develop)
ifneq ($(mode),release) ifneq ($(mode),release)
@echo "Invalid build mode." @echo "Invalid build mode."
@echo "Please use 'make mode=release' or 'make mode=develop' or 'make mode=debug'" @echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1 @exit 1
endif endif
endif endif
@ -47,37 +62,39 @@ endif
@echo ".........................." @echo ".........................."
@echo "Building on "$(mode)" mode " @echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)" @echo "CFLAGS=$(CFLAGS)"
@echo "LDLAGS=$(LDFLAGS)" @echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................." @echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o : %.o :
$(CC) -c $(CFLAGS) $(LDFLAGS) $(INCLUDE) -o $@ $< $(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
libhash_ex: libhash_ex.o
$(CC) $(CFLAGS) $(LDFLAGS) $(INCLUDE) -o $@ libhash_ex.o
libhash_ex.o: libhash_ex.[c,h] mpool.o
mpool.o: $(KOLAN_INCLUDE)/mpool.[c,h] xerror.o
netfuncs.o: $(KOLAN_INCLUDE)/netfuncs.[c,h]
listen.o: listen.[c,h] params.h xerror.o
cfg_files.o: cfg_files.[c,h] ssdparser.o
request.o: request.[c,h] ssdparser.o
ssdparser.o: $(KOLAN_PROJECTS)/multiexpat/inc/ssdparser.[c,h] $(KOLAN_INCLUDE)/c_const.h \
$(KOLAN_INCLUDE)/map1251.h $(KOLAN_INCLUDE)/insys_parser/tags.h $(KOLAN_INCLUDE)/insys_parser/const.h xmalloc.o
xmalloc.o: $(KOLAN_INCLUDE)/xmalloc.[c,h] xerror.o
signals.o: signals.[c,h] xerror.o
xerror.o: $(KOLAN_INCLUDE)/xerror.[c,h]
clean: clean:
$(RM) *.o *.out callgrind.out.* *.gcno dataserver echo-client $(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
libhash_ex.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
libhash_ex.o: \
libhash_ex.c
.PHONY: all clean

Binary file not shown.

View File

@ -1,49 +1,125 @@
# Makefile for generic linked list examples. # This file is generated with smake.sh.
# # You can use this make file with instruction make to
# Last edited: Tue Jul 28 15:36:13 1992 by bcs (Bradley C. Spatz) on wasp # use one of build mode: debug, profile, develop, release.
# # No need to call make clean if You make with other mode,
# Copyright (C) 1992 Bradley C. Spatz, bcs@ufl.edu # because the Makefile containes rules for automatically clean.
# # Some usage examples:
# This program is free software; you can redistribute it and/or modify # CFLAGS="-march=core2 -mtune=core2" make
# it under the terms of the GNU General Public License as published by # LDFLAGS="-lexpat" make mode=profile
# the Free Software Foundation; either version 2 of the License, or # Report bugs to <mecareful@gmail.com>
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
#CC = /local/bin/gcc
#CFLAGS = $(INCLUDES) -fstrength-reduce -finline-functions
PACKAGE_VERSION=2.3.1
CFLAGS += $(INCLUDES)
INCLUDES= -I..
LIBS = -L.. -llist
#LIBS = -L .. -llist # Use this for HP-UX; great loader guys!
#add macro for ranlib 4/96 *kob* - ranlib doesn't exist on solaris
RANLIB = ls
#
all: listtest queuetest stacktest
(cd cache; make)
listtest: listtest.o ../liblist.a #_________________________________
$(CC) $(CFLAGS) -o listtest listtest.o $(LIBS) # ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=-llist
TARGET0=listtest
TARGET1=queuetest
TARGET2=stacktest
TARGET= $(TARGET0) $(TARGET1) $(TARGET2)
INCLUDE1=-I$(HOME)/projects/include
INCLUDE2=-I/usr/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
queuetest: queuetest.o ../liblist.a #________________________________________
$(CC) $(CFLAGS) -o queuetest queuetest.o $(LIBS) # BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
stacktest: stacktest.o ../liblist.a CFLAGS += -Wall
$(CC) $(CFLAGS) -o stacktest stacktest.o $(LIBS) LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
listtest.o: ../list.h
queuetest.o: ../queue.h
stacktest.o: ../stack.h
clean: clean:
rm -f listtest queuetest stacktest *.o core $(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
(cd cache; make clean)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
listtest.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
target_objs1 = \
queuetest.o
$(TARGET1): $(target_objs1)
$(CC) $(LDFLAGS) -o $@ $(target_objs1)
target_objs2 = \
stacktest.o
$(TARGET2): $(target_objs2)
$(CC) $(LDFLAGS) -o $@ $(target_objs2)
listtest.o: \
listtest.c \
../list.h
queuetest.o: \
queuetest.c \
../queue.h
stacktest.o: \
stacktest.c \
../stack.h

106
c/liblist/examples/cache/Makefile vendored Normal file
View File

@ -0,0 +1,106 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=
TARGET0=cachetest
TARGET= $(TARGET0)
INCLUDE1=-I$(HOME)/projects/include
INCLUDE2=-I/usr/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
cachetest.o \
cache.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
cachetest.o: \
cachetest.c \
$(INCLUDE2)/cache.h
cache.o: \
cache.c \
$(INCLUDE2)/cache.h

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

100
c/list/Makefile Normal file
View File

@ -0,0 +1,100 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=
TARGET0=list_kernel
TARGET= $(TARGET0)
INCLUDE1=-I$(HOME)/projects/include
INCLUDE2=-I/usr/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
list_kernel.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
list_kernel.o: \
list_kernel.c

View File

@ -0,0 +1,145 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=-lstdc++
TARGET0=malloc_speed_test
TARGET1=mpool_test
TARGET2=pool_list
TARGET3=vector_add
TARGET= $(TARGET0) $(TARGET1) $(TARGET2) $(TARGET3)
INCLUDE1=$(HOME)/projects/include
INCLUDE2=/usr/local/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
malloc_speed_test.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
target_objs1 = \
mpool_test.o \
mpool.o \
xerror.o
$(TARGET1): $(target_objs1)
$(CC) $(LDFLAGS) -o $@ $(target_objs1)
target_objs2 = \
pool_list.o
$(TARGET2): $(target_objs2)
$(CC) $(LDFLAGS) -o $@ $(target_objs2)
target_objs3 = \
vector_add.o
$(TARGET3): $(target_objs3)
$(CC) $(LDFLAGS) -o $@ $(target_objs3)
malloc_speed_test.o: \
malloc_speed_test.c
mpool_test.o: \
mpool_test.c \
$(INCLUDE1)/mpool.h
pool_list.o: \
pool_list.c
vector_add.o: \
vector_add.cpp
mpool.o: \
$(INCLUDE1)/mpool.c \
$(INCLUDE1)/mpool.h \
$(INCLUDE1)/xerror.h
xerror.o: \
$(INCLUDE1)/xerror.c \
$(INCLUDE1)/xerror.h

View File

@ -1,12 +0,0 @@
#ifndef CONST_H
#define CONST_H
#ifndef TRUE
#define TRUE (1)
#endif
#ifndef FALSE
#define FALSE (0)
#endif
#endif // CONST_H

View File

@ -1,100 +0,0 @@
#include "mpool.h"
/*
* инициализация пула
*/
void mpool_init(struct mpool_s *bp, size_t nblocks, size_t mpool_block_size)
{
size_t i;
bp->nblocks = nblocks;
mpool_block_size += 2 * sizeof(struct mpool_block_s *);
bp->pool = (struct mpool_block_s *)malloc(nblocks * mpool_block_size);
if (!bp->pool)
fatal("virtual memory exhaused");
void *p = bp->pool + mpool_block_size,
*pmax = p + (nblocks - 2) * mpool_block_size;
for ( ; p < pmax; p += mpool_block_size) {
((struct mpool_block_s *)p)->prev = (struct mpool_block_s *)(p - mpool_block_size);
((struct mpool_block_s *)p)->next = (struct mpool_block_s *)(p + mpool_block_size);
}
((struct mpool_block_s *)bp->pool)->prev = NULL;
((struct mpool_block_s *)bp->pool)->next = (struct mpool_block_s *)(bp->pool + mpool_block_size);
((struct mpool_block_s *)(bp->pool + (nblocks - 1) * mpool_block_size))->prev =
(struct mpool_block_s *)(bp->pool + (nblocks - 2) * mpool_block_size);
((struct mpool_block_s *)(bp->pool + (nblocks - 1) * mpool_block_size))->next = NULL;
bp->free_pool = (struct mpool_block_s *)bp->pool;
bp->busy_pool = NULL;
}
/*
* уничтожение пула
*/
void mpool_destroy(struct mpool_s *bp)
{
free(bp->pool);
bp->nblocks = 0;
bp->pool = bp->free_pool = bp->busy_pool = NULL;
}
/*
* выдача блока из пула
*/
void *mpool_alloc(struct mpool_s *bp)
{
if (!bp->free_pool)
return NULL;
bp->free_pool->prev = bp->free_pool->next; // save free_pool->next in free_pool->prev
bp->free_pool->next = bp->busy_pool;
if (bp->busy_pool)
bp->busy_pool->prev = bp->free_pool;
bp->busy_pool = bp->free_pool;
bp->free_pool = bp->free_pool->prev;
bp->busy_pool->prev = NULL; // saved in free_pool->prev to NULL
return &bp->busy_pool->obj;
}
/*
* возвращение блока в пул
*/
void mpool_free(struct mpool_s *bp, void *p)
{
if (!p)
return;
struct mpool_block_s *b1 = (struct mpool_block_s *)(p - 2 * sizeof(struct mpool_block_s *)),
*b2 = b1->next;
if (b1->prev)
b1->prev->next = b2;
if (b2)
b2->prev = b1->prev;
if (bp->free_pool) {
b1->next = bp->free_pool;
bp->free_pool->prev = b1;
}
else
b1->next = NULL;
bp->free_pool = b2;
if (bp->busy_pool == b1)
bp->busy_pool = b2;
}

View File

@ -1,42 +0,0 @@
#ifndef MPOOL_H
#define MPOOL_H
#include <stdlib.h>
#include "const.h"
struct mpool_block_s {
struct mpool_block_s *next;
struct mpool_block_s *prev;
char obj;
};
struct mpool_s {
size_t nblocks;
void *pool;
struct mpool_block_s *free_pool;
struct mpool_block_s *busy_pool;
};
/*
* инициализация пула
*/
void mpool_init(struct mpool_s *bp, size_t nblocks, size_t mpool_block_size);
/*
* уничтожение пула
*/
void mpool_destroy(struct mpool_s *bp);
/*
* выдача блока из пула
*/
void *mpool_alloc(struct mpool_s *bp);
/*
* возвращение блока в пул
*/
void mpool_free(struct mpool_s *bp, void *p);
#endif // MPOOL_H

View File

@ -1,11 +0,0 @@
#include "xerror.h"
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
void fatal(const char *s)
{
perror(s);
exit(-1);
}

View File

@ -1,6 +0,0 @@
#ifndef XERROR_H
#define XERROR_H
void fatal(const char *s);
#endif // XERORR_H

View File

@ -1,64 +1,125 @@
TARGET=$(shell basename `pwd`) # This file is generated with smake.sh.
SOURCES=$(wildcard *.c) # You can use this make file with instruction make to
OBJECTS=$(SOURCES:%.c=%.o) # use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#CFLAGS=-march=core2 -mtune=core2 -O2 -mfpmath=sse -msse4.1 -pipe #_________________________________
#LDFLAGS=-Wl,-O1 -Wl,--as-needed # ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=-lpthread
TARGET0=echo-client
TARGET1=echo-server
TARGET= $(TARGET0) $(TARGET1)
INCLUDE1=$(HOME)/projects/include
INCLUDE2=/usr/local/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
CFLAGS+=-g $(shell pkg-config --cflags liblist) #________________________________________
LDFLAGS+=$(shell pkg-config --libs liblist) -lpthread # BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
all: $(TARGET) echo-server echo-client CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
$(OBJECTS): $(SOURCES) all: change_make_options $(TARGET)
$(TARGET): $(OBJECTS) ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
echo-server: echo-server.o xerror.o OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
echo-client: echo-client.o xerror.o %.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean: clean:
$(RM) $(OBJECTS) $(TARGET) echo-server echo-client $(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all clean .PHONY: all change_make_options clean
# c++ #_________________________________
#TARGET=$(shell basename `pwd`) # R U L E S |
#SOURCES=$(wildcard *.cpp) #________________________________|
#OBJECTS=$(SOURCES:%.cpp=%.o) target_objs0 = \
# echo-client.o \
#all: $(TARGET) netfuncs.o
#
#$(OBJECTS): $(SOURCES) $(TARGET0): $(target_objs0)
# $(CC) $(LDFLAGS) -o $@ $(target_objs0)
#$(TARGET): $(OBJECTS)
# $(CXX) -o $(TARGET) $(LDFLAGS) $(OBJECTS) $(LOADLIBES) $(LDLIBS)
#
#clean:
# $(RM) $(OBJECTS) $(TARGET)
#
#.PHONY: all clean
#CC=gcc target_objs1 = \
#CFLAGS=-c -Wall echo-server.o \
##LDFLAGS= netfuncs.o \
##INCLUDES=-I.. ./inc xerror.o
##LIBS=-L. --llist
# $(TARGET1): $(target_objs1)
## all: standserver test_xmalloc $(CC) $(LDFLAGS) -o $@ $(target_objs1)
#
#all: xerror.o xmalloc.o
# echo-client.o: \
#standserver: standserver.o xmalloc.o echo-client.c \
# $(CC) $(CFLAGS) standserver.o xmalloc.o -o standserver netfuncs.h
#
#xmalloc.o: echo-server.o: \
# $(CC) $(CFLAGS) xmalloc.c echo-server.c \
# netfuncs.h \
#xerror.o: xerror.h
# $(CC) $(CFLAGS) xerror.c
# netfuncs.o: \
#clean: netfuncs.c \
# rm -rf *.o *.gch standserver test_xmalloc netfuncs.h
xerror.o: \
xerror.c \
xerror.h

100
c/mstats_ex/Makefile Normal file
View File

@ -0,0 +1,100 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=
TARGET0=mstats_ex
TARGET= $(TARGET0)
INCLUDE1=$(HOME)/projects/include
INCLUDE2=/usr/local/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
mstats_ex.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
mstats_ex.o: \
mstats_ex.c

100
c/pthread_ex/Makefile Normal file
View File

@ -0,0 +1,100 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=-lpthread
TARGET0=pthread_rwlock_ex
TARGET= $(TARGET0)
INCLUDE1=$(HOME)/projects/include
INCLUDE2=/usr/local/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
pthread_rwlock_ex.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
pthread_rwlock_ex.o: \
pthread_rwlock_ex.c

View File

@ -1,47 +1,60 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc CC=cc
CXX=c++ CXX=c++
INCLUDE=-I$(HOME)/projects/include LIBRARIES=-lstdc++
KOLAN_PROJECTS=$(HOME)/projects TARGET0=realloc_speed_test_c
KOLAN_INCLUDE=$(KOLAN_PROJECTS)/include TARGET1=realloc_speed_test_cpp
TARGET= $(TARGET0) $(TARGET1)
INCLUDE1=$(HOME)/projects/include
INCLUDE2=/usr/local/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
# Compiler flags #________________________________________
# if mode variable is empty, setting debug build mode # BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),) ifeq ($(mode),)
mode = debug mode = debug
endif endif
ifeq ($(mode),debug) ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
CXXFLAGS = -O0 -g -std=c++0x -pedantic -Wextra -Wconversion
LDFLAGS = LDFLAGS =
endif endif
ifeq ($(mode),profile) ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
CXXFLAGS =$(CFLAGS)
LDFLAGS = -g -p LDFLAGS = -g -p
endif endif
ifeq ($(mode),develop) ifeq ($(mode),develop)
CFLAGS += -O2 -g CFLAGS += -O2 -g
CXXFLAGS = $(CFLAGS)
LDFLAGS += -O1 LDFLAGS += -O1
endif endif
ifeq ($(mode),release) ifeq ($(mode),release)
CFLAGS += -O2 CFLAGS += -O2
CXXFLAGS = $(CFLAGS)
LDFLAGS += -O1 LDFLAGS += -O1
endif endif
CFLAGS += -Wall $(shell pkg-config --cflags liblist) CFLAGS += -Wall
CXXFLAGS += -Wall $(shell pkg-config --cflags liblist) LDFLAGS += -Wall $(LIBRARIES)
LDFLAGS += -Wall $(shell pkg-config --libs liblist) -lpthread -lexpat
all: realloc_speed_test_c realloc_speed_test_cpp all: change_make_options $(TARGET)
ifneq ($(mode),debug) ifneq ($(mode),debug)
ifneq ($(mode),profile) ifneq ($(mode),profile)
ifneq ($(mode),develop) ifneq ($(mode),develop)
ifneq ($(mode),release) ifneq ($(mode),release)
@echo "Invalid build mode." @echo "Invalid build mode."
@echo "Please use 'make mode=release' or 'make mode=develop' or 'make mode=debug'" @echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1 @exit 1
endif endif
endif endif
@ -50,30 +63,61 @@ endif
@echo ".........................." @echo ".........................."
@echo "Building on "$(mode)" mode " @echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)" @echo "CFLAGS=$(CFLAGS)"
@echo "CXXFLAGS=$(CXXFLAGS)" @echo "LDFLAGS=$(LDFLAGS)"
@echo "LDLAGS=$(LDFLAGS)"
@echo ".........................." @echo ".........................."
realloc_speed_test_cpp: realloc_speed_test_cpp.o OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(INCLUDE) -o $@ realloc_speed_test_cpp.o OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
realloc_speed_test_cpp.o: realloc_speed_test_cpp.[c,h]pp change_make_options:
$(CXX) -c $(CXXFLAGS) $(LDFLAGS) $(INCLUDE) -o $@ realloc_speed_test_cpp.cpp ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o : %.o :
$(CC) -c $(CFLAGS) $(LDFLAGS) $(INCLUDE) -o $@ $< $(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
realloc_speed_test_c_obj = realloc_speed_test_c.o xalloc.o xerror.o
realloc_speed_test_c: $(realloc_speed_test_c_obj)
$(CC) $(CFLAGS) $(LDFLAGS) $(INCLUDE) -o $@ $(realloc_speed_test_c_obj)
realloc_speed_test_c.o: realloc_speed_test_c.[c,h] xalloc.o
xalloc.o: $(KOLAN_INCLUDE)/xalloc.c $(KOLAN_INCLUDE)/xalloc.h xerror.o
xerror.o: $(KOLAN_INCLUDE)/xerror.[c,h]
clean: clean:
$(RM) *.o *.out callgrind.out.* *.gcno realloc_speed_test_cpp realloc_speed_test_c $(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
realloc_speed_test_c.o \
xalloc.o \
xerror.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
target_objs1 = \
realloc_speed_test_cpp.o
$(TARGET1): $(target_objs1)
$(CC) $(LDFLAGS) -o $@ $(target_objs1)
realloc_speed_test_c.o: \
realloc_speed_test_c.c \
$(INCLUDE1)/xalloc.h
realloc_speed_test_cpp.o: \
realloc_speed_test_cpp.cpp
xalloc.o: \
$(INCLUDE1)/xalloc.c \
$(INCLUDE1)/xalloc.h \
$(INCLUDE1)/xerror.h
xerror.o: \
$(INCLUDE1)/xerror.c \
$(INCLUDE1)/xerror.h
.PHONY: all clean

100
c/stat/Makefile Normal file
View File

@ -0,0 +1,100 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=
TARGET0=stattest
TARGET= $(TARGET0)
INCLUDE1=$(HOME)/projects/include
INCLUDE2=/usr/local/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
stattest.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
stattest.o: \
stattest.c

100
c/study/Makefile Normal file
View File

@ -0,0 +1,100 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=
TARGET0=sigaction
TARGET= $(TARGET0)
INCLUDE1=$(HOME)/projects/include
INCLUDE2=/usr/local/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
sigaction.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
sigaction.o: \
sigaction.c

100
c/sysctl_ex/Makefile Normal file
View File

@ -0,0 +1,100 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=
TARGET0=_sysctl_ex
TARGET= $(TARGET0)
INCLUDE1=$(HOME)/projects/include
INCLUDE2=/usr/local/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
_sysctl_ex.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
_sysctl_ex.o: \
_sysctl_ex.c

View File

@ -19,9 +19,9 @@ long_line_column=72
current_page=4 current_page=4
FILE_NAME_0=21;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_parser_test.c;0 FILE_NAME_0=21;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_parser_test.c;0
FILE_NAME_1=298;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_parser.c;0 FILE_NAME_1=298;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_parser.c;0
FILE_NAME_2=321;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_parser.h;0 FILE_NAME_2=0;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_parser.h;0
FILE_NAME_3=133;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_parser_tags.h;0 FILE_NAME_3=133;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_parser_tags.h;0
FILE_NAME_4=1884;Make;0;16;1;1;1;/home/kolan/dev/c/tex_parser/Makefile;0 FILE_NAME_4=1146;Make;0;16;1;1;1;/home/kolan/dev/c/tex_parser/Makefile;0
[build-menu] [build-menu]
NF_00_LB=_Сделать NF_00_LB=_Сделать

100
c/the_end/Makefile Normal file
View File

@ -0,0 +1,100 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc
CXX=c++
LIBRARIES=
TARGET0=the_end
TARGET= $(TARGET0)
INCLUDE1=$(HOME)/projects/include
INCLUDE2=/usr/local/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
#________________________________________
# BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),)
mode = debug
endif
ifeq ($(mode),debug)
CFLAGS = -O0 -g -std=gnu99 -pedantic -Wextra -Wconversion
LDFLAGS =
endif
ifeq ($(mode),profile)
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
LDFLAGS = -g -p
endif
ifeq ($(mode),develop)
CFLAGS += -O2 -g
LDFLAGS += -O1
endif
ifeq ($(mode),release)
CFLAGS += -O2
LDFLAGS += -O1
endif
CFLAGS += -Wall
LDFLAGS += -Wall $(LIBRARIES)
all: change_make_options $(TARGET)
ifneq ($(mode),debug)
ifneq ($(mode),profile)
ifneq ($(mode),develop)
ifneq ($(mode),release)
@echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1
endif
endif
endif
endif
@echo ".........................."
@echo "Building on "$(mode)" mode "
@echo "CFLAGS=$(CFLAGS)"
@echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o :
$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
clean:
$(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
the_end.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
the_end.o: \
the_end.c

View File

@ -1,11 +1,28 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc CC=cc
CXX=c++ CXX=c++
INCLUDE=-I$(HOME)/projects/include LIBRARIES=
KOLAN_PROJECTS=$(HOME)/projects TARGET0=xalloc_test
KOLAN_INCLUDE=$(KOLAN_PROJECTS)/include TARGET= $(TARGET0)
INCLUDE1=$(HOME)/projects/include
INCLUDE2=/usr/local/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
# Compiler flags #________________________________________
# if mode variable is empty, setting debug build mode # BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),) ifeq ($(mode),)
mode = debug mode = debug
endif endif
@ -27,18 +44,16 @@ ifeq ($(mode),release)
endif endif
CFLAGS += -Wall CFLAGS += -Wall
#~ $(shell pkg-config --cflags liblist) LDFLAGS += -Wall $(LIBRARIES)
LDFLAGS += -Wall
#~ $(shell pkg-config --libs liblist)
all: xalloc_test all: change_make_options $(TARGET)
ifneq ($(mode),debug) ifneq ($(mode),debug)
ifneq ($(mode),profile) ifneq ($(mode),profile)
ifneq ($(mode),develop) ifneq ($(mode),develop)
ifneq ($(mode),release) ifneq ($(mode),release)
@echo "Invalid build mode." @echo "Invalid build mode."
@echo "Please use 'make mode=release' or 'make mode=develop' or 'make mode=debug'" @echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1 @exit 1
endif endif
endif endif
@ -50,20 +65,48 @@ endif
@echo "LDFLAGS=$(LDFLAGS)" @echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................." @echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o : %.o :
$(CC) -c $(CFLAGS) $(LDFLAGS) $(INCLUDE) -o $@ $< $(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
xalloc_test_obj = xalloc.o xerror.o
xalloc_test: xalloc_test.o $(xalloc_test_obj)
$(CC) $(CFLAGS) $(LDFLAGS) $(INCLUDE) -o $@ xalloc_test.o $(xalloc_test_obj)
xalloc_test.o: xalloc_test.c xalloc.o
xalloc.o: $(KOLAN_INCLUDE)/xalloc.c $(KOLAN_INCLUDE)/xalloc.h
xerror.o: $(KOLAN_INCLUDE)/xerror.c $(KOLAN_INCLUDE)/xerror.c
clean: clean:
$(RM) *.o *.out callgrind.out.* *.gcno xalloc_test $(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
xalloc_test.o \
xalloc.o \
xerror.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
xalloc_test.o: \
xalloc_test.c \
$(INCLUDE1)/xalloc.h
xalloc.o: \
$(INCLUDE1)/xalloc.c \
$(INCLUDE1)/xalloc.h \
$(INCLUDE1)/xerror.h
xerror.o: \
$(INCLUDE1)/xerror.c \
$(INCLUDE1)/xerror.h
.PHONY: all clean

View File

@ -1,11 +1,28 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc CC=cc
CXX=c++ CXX=c++
INCLUDE=-I$(HOME)/projects/include LIBRARIES=
KOLAN_PROJECTS=$(HOME)/projects TARGET0=zalloc_test
KOLAN_INCLUDE=$(KOLAN_PROJECTS)/include TARGET= $(TARGET0)
INCLUDE1=$(HOME)/projects/include
INCLUDE2=/usr/local/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
# Compiler flags #________________________________________
# if mode variable is empty, setting debug build mode # BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),) ifeq ($(mode),)
mode = debug mode = debug
endif endif
@ -27,18 +44,16 @@ ifeq ($(mode),release)
endif endif
CFLAGS += -Wall CFLAGS += -Wall
#~ $(shell pkg-config --cflags liblist) LDFLAGS += -Wall $(LIBRARIES)
LDFLAGS += -Wall
#~ $(shell pkg-config --libs liblist)
all: zalloc_test all: change_make_options $(TARGET)
ifneq ($(mode),debug) ifneq ($(mode),debug)
ifneq ($(mode),profile) ifneq ($(mode),profile)
ifneq ($(mode),develop) ifneq ($(mode),develop)
ifneq ($(mode),release) ifneq ($(mode),release)
@echo "Invalid build mode." @echo "Invalid build mode."
@echo "Please use 'make mode=release' or 'make mode=develop' or 'make mode=debug'" @echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1 @exit 1
endif endif
endif endif
@ -50,20 +65,48 @@ endif
@echo "LDFLAGS=$(LDFLAGS)" @echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................." @echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o : %.o :
$(CC) -c $(CFLAGS) $(LDFLAGS) $(INCLUDE) -o $@ $< $(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
zalloc_test_obj = zalloc.o xerror.o
zalloc_test: zalloc_test.o $(zalloc_test_obj)
$(CC) $(CFLAGS) $(LDFLAGS) $(INCLUDE) -o $@ zalloc_test.o $(zalloc_test_obj)
zalloc_test.o: zalloc_test.c zalloc.o
zalloc.o: $(KOLAN_INCLUDE)/zalloc.c $(KOLAN_INCLUDE)/zalloc.h
xerror.o: $(KOLAN_INCLUDE)/xerror.c $(KOLAN_INCLUDE)/xerror.c
clean: clean:
$(RM) *.o *.out callgrind.out.* *.gcno zalloc_test $(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
zalloc_test.o \
xerror.o \
zalloc.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
zalloc_test.o: \
zalloc_test.c \
$(INCLUDE1)/zalloc.h
zalloc.o: \
$(INCLUDE1)/zalloc.c \
$(INCLUDE1)/xerror.h \
$(INCLUDE1)/zalloc.h
xerror.o: \
$(INCLUDE1)/xerror.c \
$(INCLUDE1)/xerror.h
.PHONY: all clean

View File

@ -1,11 +1,28 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc CC=cc
CXX=c++ CXX=c++
INCLUDE=-I$(HOME)/projects/include LIBRARIES=
KOLAN_PROJECTS=$(HOME)/projects TARGET0=zalloc_ext_test
KOLAN_INCLUDE=$(KOLAN_PROJECTS)/include TARGET= $(TARGET0)
INCLUDE1=$(HOME)/projects/include
INCLUDE2=/usr/local/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
# Compiler flags #________________________________________
# if mode variable is empty, setting debug build mode # BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),) ifeq ($(mode),)
mode = debug mode = debug
endif endif
@ -27,18 +44,16 @@ ifeq ($(mode),release)
endif endif
CFLAGS += -Wall CFLAGS += -Wall
#~ $(shell pkg-config --cflags liblist) LDFLAGS += -Wall $(LIBRARIES)
LDFLAGS += -Wall
#~ $(shell pkg-config --libs liblist)
all: zalloc_ext_test all: change_make_options $(TARGET)
ifneq ($(mode),debug) ifneq ($(mode),debug)
ifneq ($(mode),profile) ifneq ($(mode),profile)
ifneq ($(mode),develop) ifneq ($(mode),develop)
ifneq ($(mode),release) ifneq ($(mode),release)
@echo "Invalid build mode." @echo "Invalid build mode."
@echo "Please use 'make mode=release' or 'make mode=develop' or 'make mode=debug'" @echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1 @exit 1
endif endif
endif endif
@ -50,24 +65,62 @@ endif
@echo "LDFLAGS=$(LDFLAGS)" @echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................." @echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o : %.o :
$(CC) -c $(CFLAGS) $(LDFLAGS) $(INCLUDE) -o $@ $< $(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
zalloc_ext_test_obj = zalloc_ext.o zalloc.o xalloc.o xerror.o
zalloc_ext_test: zalloc_ext_test.o $(zalloc_ext_test_obj)
$(CC) $(CFLAGS) $(LDFLAGS) $(INCLUDE) -o $@ zalloc_ext_test.o $(zalloc_ext_test_obj)
zalloc_ext_test.o: zalloc_ext_test.c zalloc_ext.o zalloc.o
zalloc_ext.o: $(KOLAN_INCLUDE)/zalloc_ext.c $(KOLAN_INCLUDE)/zalloc_ext.h
zalloc.o: $(KOLAN_INCLUDE)/zalloc.c $(KOLAN_INCLUDE)/zalloc.h
xalloc.o: $(KOLAN_INCLUDE)/xalloc.c $(KOLAN_INCLUDE)/xalloc.h
xerror.o: $(KOLAN_INCLUDE)/xerror.c $(KOLAN_INCLUDE)/xerror.c
clean: clean:
$(RM) *.o *.out callgrind.out.* *.gcno zalloc_ext_test $(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
zalloc_ext_test.o \
xalloc.o \
xerror.o \
zalloc.o \
zalloc_ext.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
zalloc_ext_test.o: \
zalloc_ext_test.c \
$(INCLUDE1)/xalloc.h \
$(INCLUDE1)/zalloc.h \
$(INCLUDE1)/zalloc_ext.h
xalloc.o: \
$(INCLUDE1)/xalloc.c \
$(INCLUDE1)/xalloc.h \
$(INCLUDE1)/xerror.h
zalloc.o: \
$(INCLUDE1)/zalloc.c \
$(INCLUDE1)/xerror.h \
$(INCLUDE1)/zalloc.h
zalloc_ext.o: \
$(INCLUDE1)/zalloc_ext.c \
$(INCLUDE1)/zalloc.h \
$(INCLUDE1)/zalloc_ext.h
xerror.o: \
$(INCLUDE1)/xerror.c \
$(INCLUDE1)/xerror.h
.PHONY: all clean

View File

@ -1,11 +1,28 @@
# This file is generated with smake.sh.
# You can use this make file with instruction make to
# use one of build mode: debug, profile, develop, release.
# No need to call make clean if You make with other mode,
# because the Makefile containes rules for automatically clean.
# Some usage examples:
# CFLAGS="-march=core2 -mtune=core2" make
# LDFLAGS="-lexpat" make mode=profile
# Report bugs to <mecareful@gmail.com>
#_________________________________
# ENVIRONMENT |
#________________________________|
CC=cc CC=cc
CXX=c++ CXX=c++
INCLUDE=-I$(HOME)/projects/include LIBRARIES=
KOLAN_PROJECTS=$(HOME)/projects TARGET0=zerror_test
KOLAN_INCLUDE=$(KOLAN_PROJECTS)/include TARGET= $(TARGET0)
INCLUDE1=$(HOME)/projects/include
INCLUDE2=/usr/local/include
INCLUDE=-I$(INCLUDE1) -I$(INCLUDE2)
# Compiler flags #________________________________________
# if mode variable is empty, setting debug build mode # BUILD SCRIPT (don't change) |
#_______________________________________|
ifeq ($(mode),) ifeq ($(mode),)
mode = debug mode = debug
endif endif
@ -27,18 +44,16 @@ ifeq ($(mode),release)
endif endif
CFLAGS += -Wall CFLAGS += -Wall
#~ $(shell pkg-config --cflags liblist) LDFLAGS += -Wall $(LIBRARIES)
LDFLAGS += -Wall
#~ $(shell pkg-config --libs liblist) -lpthread -lexpat
all: zerror_test all: change_make_options $(TARGET)
ifneq ($(mode),debug) ifneq ($(mode),debug)
ifneq ($(mode),profile) ifneq ($(mode),profile)
ifneq ($(mode),develop) ifneq ($(mode),develop)
ifneq ($(mode),release) ifneq ($(mode),release)
@echo "Invalid build mode." @echo "Invalid build mode."
@echo "Please use 'make mode=release', 'make mode=develop' or 'make mode=debug'" @echo "Please use 'make mode=release', 'make mode=develop', 'make mode=profile' or 'make mode=debug'"
@exit 1 @exit 1
endif endif
endif endif
@ -50,20 +65,48 @@ endif
@echo "LDFLAGS=$(LDFLAGS)" @echo "LDFLAGS=$(LDFLAGS)"
@echo ".........................." @echo ".........................."
OLD_BUILD_MODE=$(shell grep ^MODE make_options.out 2>/dev/null | sed 's~^MODE=~~')
OLD_BUILD_CFLAGS=$(shell grep ^CFLAGS make_options.out 2>/dev/null | sed 's~^CFLAGS=~~')
OLD_BUILD_LDFLAGS=$(shell grep ^LDFLAGS make_options.out 2>/dev/null | sed 's~^LDFLAGS=~~')
change_make_options:
ifneq ($(mode)|$(CFLAGS)|$(LDFLAGS), $(OLD_BUILD_MODE)|$(OLD_BUILD_CFLAGS)|$(OLD_BUILD_LDFLAGS))
@echo CLEANING...
@make clean &>/dev/null
@echo MODE=$(mode) > make_options.out
@echo CFLAGS=$(CFLAGS) >> make_options.out
@echo LDFLAGS=$(LDFLAGS) >> make_options.out
endif
%.o : %.o :
$(CC) -c $(CFLAGS) $(LDFLAGS) $(INCLUDE) -o $@ $< $(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
zerror_test_obj = zerror_test.o zerror.o xerror.o
zerror_test: $(zerror_test_obj)
$(CC) $(CFLAGS) $(LDFLAGS) $(INCLUDE) -o $@ $(zerror_test_obj)
zerror_test.o: zerror_test.c $(KOLAN_INCLUDE)/zerror.h $(KOLAN_INCLUDE)/xerror.h
zerror.o: $(KOLAN_INCLUDE)/zerror.c $(KOLAN_INCLUDE)/zerror.h $(KOLAN_INCLUDE)/xerror.h
xerror.o: $(KOLAN_INCLUDE)/xerror.c $(KOLAN_INCLUDE)/xerror.h
clean: clean:
$(RM) *.o *.out callgrind.out.* *.gcno tex_parser_test $(RM) *.o *.out callgrind.out.* *.gcno $(TARGET)
.PHONY: all change_make_options clean
#_________________________________
# R U L E S |
#________________________________|
target_objs0 = \
zerror_test.o \
xerror.o \
zerror.o
$(TARGET0): $(target_objs0)
$(CC) $(LDFLAGS) -o $@ $(target_objs0)
zerror_test.o: \
zerror_test.c \
$(INCLUDE1)/zerror.h
zerror.o: \
$(INCLUDE1)/zerror.c \
$(INCLUDE1)/xerror.h \
$(INCLUDE1)/zerror.h
xerror.o: \
$(INCLUDE1)/xerror.c \
$(INCLUDE1)/xerror.h
.PHONY: all clean

View File

@ -52,7 +52,7 @@ void test0()
printf("z_propagate_prefixed_error = {%d, %d, %s}\n", zs_pe2->domain, zs_pe2->code, zs_pe2->message); printf("z_propagate_prefixed_error = {%d, %d, %s}\n", zs_pe2->domain, zs_pe2->code, zs_pe2->message);
zerror_free(zs); zerror_free(zs);
zs_l = zerror_free_null(zs_l); z_clear_error(&zs_l);
zerror_free(zs_cp); zerror_free(zs_cp);
//~ z_clear_error(&zs_se_l); // not need clear, because zs_se_l propagated to zs_pe2 //~ z_clear_error(&zs_se_l); // not need clear, because zs_se_l propagated to zs_pe2
//~ z_clear_error(&zs_se); // not need clear, because zs_se propagated to zs_pe //~ z_clear_error(&zs_se); // not need clear, because zs_se propagated to zs_pe