Skip to content

Commit

Permalink
0.999l: library
Browse files Browse the repository at this point in the history
  • Loading branch information
zvezdochiot committed Aug 5, 2022
1 parent 86466e3 commit 728affc
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
27 changes: 23 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
############################################################################

TARGET = ha
SOVER = 0

CC ?= gcc
CFLAGS ?= -Wall -O2
LDFLAGS ?= $(CFLAGS) -s
AR = ar

SRCS = src/acoder.c \
src/archive.c \
Expand All @@ -35,19 +37,36 @@ SRCS = src/acoder.c \
src/info.c \
src/machine.c \
src/misc.c \
src/swdict.c \
src/ha.c
src/swdict.c
SRCT = src/ha.c
OBJS = $(SRCS:%.c=%.o)
OBJT = $(SRCT:%.c=%.o)
RM ?= rm -f

$(TARGET): $(OBJS)
ifneq ($(shell uname -m), i386)
CFLAGS += -fPIC
endif

ifeq ($(SHARED),Y)
TLIB = lib$(TARGET).so.$(SOVER)
else
TLIB = lib$(TARGET).a
endif

$(TARGET): $(OBJT) $(TLIB)
$(CC) $(LDFLAGS) $^ -o $@

lib$(TARGET).a: $(OBJS)
$(AR) rcs $@ $^

lib$(TARGET).so.$(SOVER): $(OBJS)
$(CC) -shared -Wl,-soname,$@ $(LDFLAGS) $^ -o $@

.c.o:
$(CC) $(CFLAGS) -c $< -o $@

clean:
$(RM) $(TARGET) $(OBJS)
$(RM) $(TARGET) $(OBJT) lib$(TARGET).so.$(SOVER) lib$(TARGET).a $(OBJS)

install: $(TARGET)
mkdir -p $(DESTDIR)/usr/bin
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
`ORG.FSMS:`
![GitHub release (latest by date)](https://img.shields.io/github/v/release/FS-make-simple/ha)
![GitHub Release Date](https://img.shields.io/github/release-date/FS-make-simple/ha)
![GitHub repo size](https://img.shields.io/github/repo-size/FS-make-simple/ha)
![GitHub all releases](https://img.shields.io/github/downloads/FS-make-simple/ha/total)
![GitHub](https://img.shields.io/github/license/FS-make-simple/ha)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/FS-make-simple/libha)
![GitHub Release Date](https://img.shields.io/github/release-date/FS-make-simple/libha)
![GitHub repo size](https://img.shields.io/github/repo-size/FS-make-simple/libha)
![GitHub all releases](https://img.shields.io/github/downloads/FS-make-simple/libha/total)
![GitHub](https://img.shields.io/github/license/FS-make-simple/libha)

# HA

Expand Down
2 changes: 1 addition & 1 deletion src/machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <sys/stat.h>
#include <signal.h>

#define BETA "с"
#define BETA "l"
typedef short S16B;
typedef unsigned short U16B;
typedef long S32B;
Expand Down

0 comments on commit 728affc

Please sign in to comment.