Skip to content

Instantly share code, notes, and snippets.

@lighth7015
Created February 1, 2019 22:04
Show Gist options
  • Save lighth7015/730d200ee9c3a271eb364108a5556ddb to your computer and use it in GitHub Desktop.
Save lighth7015/730d200ee9c3a271eb364108a5556ddb to your computer and use it in GitHub Desktop.
What am I not seeing here? the $(SHARED) target should create a .so file, right?
CC = clang
CFLAGS = -Wall -ggdb3 -std=gnu11 -O0 -Iinclude
OBJDIR = build
BINDIR = bin
LIBDIR = lib
TARGET = $(BINDIR)/obj_test
SHARED = $(LIBDIR)/giza.so
LINKER = support/version.ld
SOURCES = $(shell echo src/*.c)
HEADERS = $(shell echo include/*.h)
OBJECTS = $(SOURCES:.c=.o)
.phony:
all: directories $(SHARED) $(TARGET)
directories:
mkdir -p $(OBJDIR)
mkdir -p $(LIBDIR)
mkdir -p $(BINDIR)
clean:
rm -rf $(OBJDIR)/*
rm -f $(BINDIR)/*
$(TARGET): $(SHARED)
$(CC) -Iinclude -o $@ $(CFLAGS) $(SHARED) sample/main.c
$(SOURCES:.c=.o):%.o:%.c
$(CC) -c $(FLAGS) -fPIC $(CFLAGS) -D $(subst SRC/,,$(shell echo ${@:.o=} | tr a-z A-Z)) -o ${subst src,build,$@} $<
$(SHARED): ${subst src,build,$^}
$(CC) -shared -T $(LINKER) -o $(SHARED) ${subst src,build,$(OBJECTS)}
/*
* ================================================================
* "You are not expected to understand this." - Sixth Edition UNIX
* "Ooh... black magic." - Rudy Valencia
*
* "I don't get or understand how or WHY this works... but, damned
* if it doesn't." - Robert Butler
* ================================================================
*/
WORKSTATION_1.0 {
global:
GetIterator;
NextIterator;
IteratorEnd;
Count;
SecurityAttribute;
SecurityDescriptor;
AssignAttribute;
AssignDescriptor;
Font;
FontSetFace;
FontSetSize;
FontSetStyle;
Iterator;
End;
AllocObject;
CreateObject;
DeleteObject;
IObjectCreate;
IObjectDelete;
IObjectQuery;
IsHandle;
DeleteItem;
Vector;
Window;
SetText;
AppendStyle;
SetStyle;
RemoveStyle;
local:
__GetIterator_workstation_1_0;
__NextIterator_workstation_1_0;
__IteratorEnd_workstation_1_0;
__Count_workstation_1_0;
__NewSecurityAttribute_workstation_1_0;
__NewSecurityDescriptor_workstation_1_0;
__AssignAttribute_workstation_1_0;
__AssignDescriptor_workstation_1_0;
__NewFont_workstation_1_0;
__SetFontFace_workstation_1_0;
__SetFontSize_workstation_1_0;
__SetFontStyle_workstation_1_0;
__BeginIterator_workstation_1_0;
__EndIterator_workstation_1_0;
__AllocObject_workstation_1_0;
__CreateObject_workstation_1_0;
__DeleteObject_workstation_1_0;
__workstation_IsHandle_workstation_1_0;
__DeleteItem_workstation_1_0;
__Vector_workstation_1_0;
__NewWindow_workstation_1_0;
__SetWindowText_workstation_1_0;
__AppendStyle_workstation_1_0;
__RemoveStyle_workstation_1_0;
TaggedObjectAlloc;
SetObjectInstance;
GetObjectInstance;
GetInstSignature;
IObjectCreateV1;
IObjectDeleteV1;
IObjectQueryInfoV1;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment