Compare commits

...

2 Commits

Author SHA1 Message Date
Aleksei Chubukov
2fa5d60e6e Merge branch 'master' of git.brass.host:tea/c_piscine__offshore_mains 2023-11-22 00:41:16 +04:00
Aleksei Chubukov
894b32fe2f say hello to this abom^H^H^H^H cute Makefile 2023-11-22 00:40:57 +04:00
11 changed files with 29 additions and 2 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
build
*.swp

22
Makefile Normal file
View File

@ -0,0 +1,22 @@
#location of test mains
OFFSHORE_MAINS := .
# location of project directories
OFFSHORE_PROJECTS := ..
empty:=
space:= $(empty) $(empty)
CFLAGS_MANDATORY := -Wall -Wextra -Werror
all: $(foreach e, 00 01 02 03 04 05 06 07 08, build/c00/ex$e)
build:
mkdir $@
norme:
norminette -R CheckForbiddenSourceHeader ../c$(subst _,$(space),)
clean:
rm -rf build
.SECONDEXPANSION:
build/c%: $(OFFSHORE_PROJECTS)/c$$(subst _,+,$$*)/*.c $$(OFFSHORE_MAINS)/c$$*.c
mkdir -p $(@D)
$(CC) -o $@ $(CFLAGS_MANDATORY) $(CFLAGS) $^
.PHONY: all norme clean

View File

@ -1,8 +1,11 @@
void ft_putnbr(int); void ft_putnbr(int);
void ft_putchar(char); void ft_putchar(char);
#include <limits.h>
#include <stdio.h>
int main(void) int main(void)
{ {
ft_putnbr(0xEFFFFFFF); printf("%d = \n", INT_MIN);
ft_putnbr(INT_MIN);
ft_putchar('\n'); ft_putchar('\n');
ft_putnbr(-7141); ft_putnbr(-7141);
ft_putchar('\n'); ft_putchar('\n');
@ -20,6 +23,6 @@ int main(void)
ft_putchar('\n'); ft_putchar('\n');
ft_putnbr(0xBADF00D); ft_putnbr(0xBADF00D);
ft_putchar('\n'); ft_putchar('\n');
ft_putnbr(0x7FFFFFFF); ft_putnbr(INT_MAX);
ft_putchar('\n'); ft_putchar('\n');
} }